forked from PracticumGrade/python-tools-3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_package.py
More file actions
30 lines (24 loc) · 899 Bytes
/
Copy pathtest_package.py
File metadata and controls
30 lines (24 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
import pytest
def test_exists_tests_package():
expected_folder = "tests"
assert os.path.exists(expected_folder), (
f"Убедитесь, что в проекте `python-tools-3` "
f"создана папка `{expected_folder}`"
)
assert "__init__.py" in os.listdir(expected_folder), (
f"Убедитесь, что в проекте `python-tools-3` "
f"`{expected_folder}` является пакетом."
)
@pytest.mark.parametrize(
"test_module", [
"test_annotation.py",
"test_main.py",
"test_package.py",
]
)
def test_tests_package_contains_case(test_module):
assert test_module in os.listdir("tests"), (
f"Убедитесь, что в проекте `python-tools-3` "
f"в пакете `tests` содержится модуль {test_module}."
)