Skip to content

Commit

Permalink
Remove obsolete setuptools test integration
Browse files Browse the repository at this point in the history
`make pytest` already runs a superset of all the tests run by `python3
setup-css.py test` and `python3 setup-js.py test`.  (The former didn't
work anyway due to a typo.)

Fixes: #2300, #2301
  • Loading branch information
cjwatson committed Jul 29, 2024
1 parent 0863e19 commit 286aaf5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
26 changes: 0 additions & 26 deletions python/setup-css.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,8 @@
#!/usr/bin/env python

import os
import sys

from setuptools import setup
from cssbeautifier.__version__ import __version__

from setuptools.command.test import test as TestCommand

DIR_CSS = "cssbeautifier/tests/"


class PyTestCSS(TestCommand):
user_options = [("pytest-args=", "a", "Arguments to pass to py.test")]

def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ["--assert=plain"] + [
DIR + x for x in os.listdir(DIR) if x.endswith(".py") and x[0] not in "._"
]

def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest

errno = pytest.main(self.pytest_args)
sys.exit(errno)


setup(
name="cssbeautifier",
Expand All @@ -45,6 +21,4 @@ def run_tests(self):
],
install_requires=["jsbeautifier", "six>=1.13.0", "editorconfig>=0.12.2"],
license="MIT",
test_suite="pytest.collector",
cmdclass={"test": PyTestCSS},
)
26 changes: 0 additions & 26 deletions python/setup-js.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,8 @@
#!/usr/bin/env python

import os
import sys

from setuptools import setup
from jsbeautifier.__version__ import __version__

from setuptools.command.test import test as TestCommand

DIR = "jsbeautifier/tests/"


class PyTest(TestCommand):
user_options = [("pytest-args=", "a", "Arguments to pass to py.test")]

def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ["--assert=plain"] + [
DIR + x for x in os.listdir(DIR) if x.endswith(".py") and x[0] not in "._"
]

def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest

errno = pytest.main(self.pytest_args)
sys.exit(errno)


setup(
name="jsbeautifier",
Expand All @@ -52,6 +28,4 @@ def run_tests(self):
],
install_requires=["six>=1.13.0", "editorconfig>=0.12.2"],
license="MIT",
test_suite="pytest.collector",
cmdclass={"test": PyTest},
)

0 comments on commit 286aaf5

Please sign in to comment.