From 3ebe5bba7f0096ab19c28eac57cdfad1d4d23ce5 Mon Sep 17 00:00:00 2001 From: DasMoorhuhn Date: Thu, 7 Dec 2023 22:12:56 +0100 Subject: [PATCH] fixed test call --- tests/.coveragerc => .coveragerc | 0 README.md | 2 +- tests/pytest.ini => pytest.ini | 2 +- tests/start_tests.sh | 1 + tests/test_scan_dir.py | 3 +-- 5 files changed, 4 insertions(+), 4 deletions(-) rename tests/.coveragerc => .coveragerc (100%) rename tests/pytest.ini => pytest.ini (69%) create mode 100755 tests/start_tests.sh diff --git a/tests/.coveragerc b/.coveragerc similarity index 100% rename from tests/.coveragerc rename to .coveragerc diff --git a/README.md b/README.md index 97dbde6..1359056 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,6 @@ Dies ist die dritte Version von AutoPicture. # Tests ```bash -python3.10 -m pytest --no-header -rfp --cov --cov-report html:tests/coverage --cov-report xml:tests/coverage/coverage.xml tests/ +sh ./tests/start_tests.sh ``` diff --git a/tests/pytest.ini b/pytest.ini similarity index 69% rename from tests/pytest.ini rename to pytest.ini index 11422c9..16d574f 100644 --- a/tests/pytest.ini +++ b/pytest.ini @@ -1,3 +1,3 @@ [pytest] -pythonpath = . +pythonpath = tests addopts = --ignore-glob=**/tests/** \ No newline at end of file diff --git a/tests/start_tests.sh b/tests/start_tests.sh new file mode 100755 index 0000000..7c64f2f --- /dev/null +++ b/tests/start_tests.sh @@ -0,0 +1 @@ +python3.10 -m pytest --no-header -rfp --cov --cov-report html:tests/coverage --cov-report xml:tests/coverage/coverage.xml tests/ \ No newline at end of file diff --git a/tests/test_scan_dir.py b/tests/test_scan_dir.py index fde5766..e24a512 100644 --- a/tests/test_scan_dir.py +++ b/tests/test_scan_dir.py @@ -14,7 +14,7 @@ class TestScanFolder(unittest.TestCase): create_file(file='img_01.jpeg') files = scan_folder(TEST_FOLDER) delete_folder() - + assert len(files) == 1 def test_scan_empty_folder(self): @@ -43,4 +43,3 @@ class TestScanFolder(unittest.TestCase): delete_folder() assert len(files) == 0 -