diff --git a/.coveragerc b/.coveragerc index b160954c384..a15df8f1158 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,4 +1,4 @@ [run] branch = True source = codespell_lib -omit = */codespell_lib/tests/* +omit = */tests/* diff --git a/.github/workflows/codespell-private.yml b/.github/workflows/codespell-private.yml index 1ad4e3b1a4f..4b56cbcc025 100644 --- a/.github/workflows/codespell-private.yml +++ b/.github/workflows/codespell-private.yml @@ -39,9 +39,9 @@ jobs: - run: codespell --help - run: codespell --version - run: make check - - run: codespell --check-filenames --skip="./.git/*,*.pyc,./codespell_lib/tests/test_basic.py,./codespell_lib/data/*,./example/code.c,./build/lib/codespell_lib/tests/test_basic.py,./build/lib/codespell_lib/data/*,README.rst,*.egg-info/*" + - run: codespell --check-filenames --skip="./.git/*,*.pyc,./tests/test_basic.py,./codespell_lib/data/*,./example/code.c,./build/lib/tests/test_basic.py,./build/lib/codespell_lib/data/*,README.rst,*.egg-info/*" # this file has an error - - run: "! codespell codespell_lib/tests/test_basic.py" + - run: "! codespell tests/test_basic.py" - run: codecov make-check-dictionaries: diff --git a/MANIFEST.in b/MANIFEST.in index e467a2b2422..450c9059bb8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ include codespell_lib/__init__.py recursive-include codespell_lib *.py +recursive-include tests *.py include codespell_lib/data/dictionary*.txt include codespell_lib/data/linux-kernel.exclude include COPYING diff --git a/Makefile b/Makefile index 5cbe5e0990f..b9e6ca8fbc9 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ check-dictionaries: fi; \ done @if command -v pytest > /dev/null; then \ - pytest codespell_lib/tests/test_dictionary.py; \ + pytest tests/test_dictionary.py; \ else \ echo "Test dependencies not present, install using 'pip install -e \".[dev]\"'"; \ exit 1; \ @@ -54,7 +54,7 @@ flake8: flake8 pytest: - pytest codespell_lib + pytest clean: rm -rf codespell.1 diff --git a/appveyor.yml b/appveyor.yml index 79740cac8cd..766e25530dd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,7 +22,7 @@ build: false # Not a C# project, build stuff at the test step instead. test_script: - "codespell --help" - "flake8" - - "pytest codespell_lib" + - "pytest" on_success: - "codecov" diff --git a/codespell_lib/tests/__init__.py b/tests/__init__.py similarity index 100% rename from codespell_lib/tests/__init__.py rename to tests/__init__.py diff --git a/codespell_lib/tests/test_basic.py b/tests/test_basic.py similarity index 100% rename from codespell_lib/tests/test_basic.py rename to tests/test_basic.py diff --git a/codespell_lib/tests/test_dictionary.py b/tests/test_dictionary.py similarity index 99% rename from codespell_lib/tests/test_dictionary.py rename to tests/test_dictionary.py index 6d246d35acd..74b95f8d9df 100644 --- a/codespell_lib/tests/test_dictionary.py +++ b/tests/test_dictionary.py @@ -8,6 +8,7 @@ import pytest +import codespell_lib from codespell_lib._codespell import _builtin_dictionaries from codespell_lib._codespell import supported_languages @@ -32,7 +33,7 @@ global_pairs = set() # Filename, should be seen as errors in aspell or not -_data_dir = op.join(op.dirname(__file__), '..', 'data') +_data_dir = op.join(op.dirname(codespell_lib.__file__), 'data') _fnames_in_aspell = [ (op.join(_data_dir, 'dictionary%s.txt' % d[2]), d[3:5], d[5:7]) for d in _builtin_dictionaries]