Do not use hardcoded slash separator for windows support

This commit is contained in:
Davidovich 2014-08-29 15:42:06 -04:00
parent 0f5b325aba
commit 97f3cebe1b
1 changed files with 5 additions and 4 deletions

View File

@ -17,11 +17,12 @@ def pytest_collection_modifyitems(items):
os.path.commonprefix([__file__, item.module.__file__]),
)
if (module_path.startswith("functional/")
or module_path.startswith("integration/")
or module_path.startswith("lib/")):
module_root_dir = module_path.split(os.pathsep)[0]
if (module_root_dir.startswith("functional")
or module_root_dir.startswith("integration")
or module_root_dir.startswith("lib")):
item.add_marker(pytest.mark.integration)
elif module_path.startswith("unit/"):
elif module_root_dir.startswith("unit"):
item.add_marker(pytest.mark.unit)
# We don't want to allow using the script resource if this is a