Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[pytest]
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
addopts =
--cov=.
--cov-report=term-missing
--cov-report=html
-v
--doctest-modules
--strict-markers

markers =
unit: marks unit tests
integration: marks integration tests
slow: marks slow tests

filterwarnings =
ignore::DeprecationWarning
ignore::UserWarning
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ Werkzeug==1.0.1
wrapt==1.12.1
xlrd==1.2.0
XlsxWriter==1.2.8
# Test dependencies
pytest
pytest-cov
26 changes: 26 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import os
import sys
import pytest

# Add project root to Python path
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

def pytest_configure(config):
"""
Configure pytest settings and add custom markers
"""
config.addinivalue_line(
"markers",
"unit: mark a test as a unit test"
)
config.addinivalue_line(
"markers",
"integration: mark a test as an integration test"
)

@pytest.fixture(scope='session')
def project_root():
"""
Fixture to provide the project root directory path
"""
return os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
16 changes: 16 additions & 0 deletions tests/test_basic_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os
import pytest

def test_project_structure(project_root):
"""
Verify basic project configuration
"""
assert os.path.exists(project_root), "Project root directory should exist"
assert os.path.exists(os.path.join(project_root, 'app.py')), "Main application file should exist"

@pytest.mark.unit
def test_pytest_markers():
"""
Ensure pytest can recognize custom markers
"""
assert True, "Unit marker test should pass"