Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove slow_test pytest marker #120

Merged
merged 4 commits into from
Feb 20, 2024
Merged
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
4 changes: 0 additions & 4 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ def test(ctx, all=False):
'--timeout=30' # Each test should timeout after 30 sec
]

# Default to not running the slow tests.
if not all:
test_cmd.append('-m "not slow_test"')

# Test in this directory
test_cmd.append("tests")

Expand Down
23 changes: 0 additions & 23 deletions tests/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,6 @@ def _samefile(x, y):
sys.path.insert(0, path)


# Check if pytest is imported. If so, we use it to create marking decorators.
# If not, we just create a function that does nothing.
try:
import pytest
except ImportError:
pytest = None

if pytest is not None:
slow_test = pytest.mark.slow_test
xfail = pytest.mark.xfail

else:

def slow_test(x):
return x

def xfail(*args, **kwargs):
if len(args) > 0 and isinstance(args[0], types.FunctionType):
return args[0]

return lambda x: x


# We don't use the pytest parametrizing function, since it seems to break
# with unittest.TestCase subclasses.
def parametrize(field_names, field_values):
Expand Down
4 changes: 1 addition & 3 deletions tests/test_multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
parse_options_header,
)

from .compat import parametrize, parametrize_class, slow_test
from .compat import parametrize, parametrize_class

if TYPE_CHECKING:
from multipart.multipart import FileConfig
Expand Down Expand Up @@ -905,7 +905,6 @@ def test_feed_blocks(self):
# Assert that our field is here.
self.assert_field(b"field", b"0123456789ABCDEFGHIJ0123456789ABCDEFGHIJ")

@slow_test
def test_request_body_fuzz(self):
"""
This test randomly fuzzes the request body to ensure that no strange
Expand Down Expand Up @@ -978,7 +977,6 @@ def test_request_body_fuzz(self):
print("Failures: %d" % (failures,))
print("Exceptions: %d" % (exceptions,))

@slow_test
def test_request_body_fuzz_random_data(self):
"""
This test will fuzz the multipart parser with some number of iterations
Expand Down