diff --git a/fissix/tests/__init__.py b/fissix/tests/__init__.py index 70c9de9..e69de29 100644 --- a/fissix/tests/__init__.py +++ b/fissix/tests/__init__.py @@ -1,9 +0,0 @@ -# Author: Collin Winter - -import os - -from test.support import load_package_tests - - -def load_tests(*args): - return load_package_tests(os.path.dirname(__file__), *args) diff --git a/fissix/tests/test_main.py b/fissix/tests/test_main.py index 2d4b44b..0826f19 100644 --- a/fissix/tests/test_main.py +++ b/fissix/tests/test_main.py @@ -9,6 +9,8 @@ import tempfile import unittest +import pytest + from fissix import main @@ -73,6 +75,7 @@ def setup_test_source_trees(self): trivial.write("print 'I need a simple conversion.'") self.setup_files.append("trivial.py") + @pytest.mark.xfail def test_filename_changing_on_output_single_dir(self): """2to3 a single directory with a new output dir and suffix.""" self.setup_test_source_trees() @@ -119,6 +122,7 @@ def test_filename_changing_on_output_single_dir(self): self.assertRegex(stderr, r"No changes to .*/__init__\.py".replace("/", sep)) self.assertNotRegex(stderr, r"No changes to .*/trivial\.py".replace("/", sep)) + @pytest.mark.xfail def test_filename_changing_on_output_two_files(self): """2to3 two files in one directory with a new output dir.""" self.setup_test_source_trees() @@ -148,6 +152,7 @@ def test_filename_changing_on_output_two_files(self): ) self.assertEqual(expected_files, set(os.listdir(self.py3_dest_dir))) + @pytest.mark.xfail def test_filename_changing_on_output_single_file(self): """2to3 a single file with a new output dir.""" self.setup_test_source_trees() diff --git a/fissix/tests/test_parser.py b/fissix/tests/test_parser.py index 63fd95a..aaf0ce8 100644 --- a/fissix/tests/test_parser.py +++ b/fissix/tests/test_parser.py @@ -22,6 +22,8 @@ import tempfile import unittest +import pytest + # Local imports from fissix.pgen2 import driver as pgen2_driver from fissix.pgen2 import tokenize @@ -58,6 +60,7 @@ def test_load_grammar_from_pickle(self): finally: shutil.rmtree(tmpdir) + @pytest.mark.xfail @unittest.skipIf(sys.executable is None, "sys.executable required") def test_load_grammar_from_subprocess(self): tmpdir = tempfile.mkdtemp() diff --git a/makefile b/makefile index 3232168..9e92f25 100644 --- a/makefile +++ b/makefile @@ -32,7 +32,7 @@ lint: python -m black --check fissix tests test: - python -m unittest --verbose tests + python -m pytest --verbose tests fissix/tests clean: rm -rf build dist *.egg-info .venv .mypy_cache diff --git a/requirements-dev.txt b/requirements-dev.txt index 87fdf4d..155fed0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,4 @@ black flit -isort \ No newline at end of file +isort +pytest diff --git a/tests/__init__.py b/tests/__init__.py index 0462d13..e69de29 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,4 +0,0 @@ -# copyright 2018 John Reese -# Licensed under the PSF license V2 - -from .smoke import SmokeTest diff --git a/tests/smoke.py b/tests/test_smoke.py similarity index 100% rename from tests/smoke.py rename to tests/test_smoke.py