From a1b6e7199727ef7ffa276fb007cfa0502514ee4b Mon Sep 17 00:00:00 2001 From: konradudohannes Date: Sat, 30 May 2020 19:16:25 +0200 Subject: [PATCH 1/2] added test case to catch project strucutre errors in tox --- tests/unit_tests/test_project_structure.py | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/unit_tests/test_project_structure.py diff --git a/tests/unit_tests/test_project_structure.py b/tests/unit_tests/test_project_structure.py new file mode 100644 index 0000000..e01d381 --- /dev/null +++ b/tests/unit_tests/test_project_structure.py @@ -0,0 +1,25 @@ +import os +import datenguidepy.query_builder + + +def test_project_structure(): + """Test package loading in tox. + + The package struture has an issue in combination + with tox and pytest. Tox packages and installs an sdist + of the package, nevertheless when the tests are executed + this installed package is shadowed by the (not installed) + version of the package in the project folder. This happens + because pytest dynamically adds paths to sys.path + to run the test cases. The problem with this is that error + in the MANIFEST.in are not caught when modules from the + projects folder are used instead of the installd sdist. + + This testcase checks for a file in the module folder of query_builder. + This file is NOT in the Manifest.in and should therefore not + be found in a tox test. + """ + mod_dir = os.path.dirname(os.path.abspath(datenguidepy.query_builder.__file__)) + test_file = "TEST_PROJECT_STRUCTURE" + test_path = os.path.join(mod_dir, test_file) + assert not os.path.isfile(test_path) From 3cab3444ee0c37d1961ebb78d030e4efb61f64a4 Mon Sep 17 00:00:00 2001 From: konradudohannes Date: Sat, 30 May 2020 19:33:17 +0200 Subject: [PATCH 2/2] added the emty test file for the new test case --- datenguidepy/TEST_PROJECT_STRUCTURE | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 datenguidepy/TEST_PROJECT_STRUCTURE diff --git a/datenguidepy/TEST_PROJECT_STRUCTURE b/datenguidepy/TEST_PROJECT_STRUCTURE new file mode 100644 index 0000000..e69de29