initial commit
This commit is contained in:
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
14
tests/conftest.py
Normal file
14
tests/conftest.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import sys
|
||||
import pytest
|
||||
|
||||
|
||||
# each test runs on cwd to its temp dir
|
||||
@pytest.fixture(autouse=True)
|
||||
def go_to_tmpdir(request):
|
||||
# Get the fixture dynamically by its name.
|
||||
tmpdir = request.getfixturevalue("tmpdir")
|
||||
# ensure local test created packages can be imported
|
||||
sys.path.insert(0, str(tmpdir))
|
||||
# Chdir only for the duration of the test.
|
||||
with tmpdir.as_cwd():
|
||||
yield
|
||||
5
tests/test_base.py
Normal file
5
tests/test_base.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from project_name.base import NAME
|
||||
|
||||
|
||||
def test_base():
|
||||
assert NAME == "project_name"
|
||||
Reference in New Issue
Block a user