Skip to content

Commit

Permalink
Test samples on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
torbsorb committed Jul 14, 2020
1 parent c860ee1 commit 8e999b9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
7 changes: 1 addition & 6 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,8 @@ def __exit__(self, etype, value, traceback):

@pytest.helpers.register
def run_sample(name, working_directory=None):
current_working_directory = Path(os.getcwd()).resolve()
sample = (
current_working_directory
/ ".."
/ ".."
/ "samples"
/ "sample_{name}.py".format(name=name)
Path(__file__) / ".." / ".." / "samples" / "sample_{name}.py".format(name=name)
).resolve()

if working_directory is not None:
Expand Down
8 changes: 0 additions & 8 deletions test/test_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@
import pytest


@pytest.mark.skipif(
platform.system() == "Windows",
reason=r"python: can't open file 'D:\a\samples\sample_capture_from_file.py': [Errno 2] No such file or directory",
)
def test_capture_from_file(sample_data_file):
pytest.helpers.run_sample(
name="capture_from_file", working_directory=sample_data_file.parent
)


@pytest.mark.skipif(
platform.system() == "Windows",
reason=r"python: can't open file 'D:\a\samples\sample_print_version_info.py': [Errno 2] No such file or directory",
)
def test_print_version_info():
pytest.helpers.run_sample(name="print_version_info")

0 comments on commit 8e999b9

Please sign in to comment.