Skip to content

Commit

Permalink
Merge branch 'master' into js-mime-type-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vytas7 authored Jun 3, 2023
2 parents d140749 + b16b6c3 commit a7f7008
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a final newline; trim trailing whitespace
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Set default charset for sources
[*.{html,js,py,pyx}]
charset = utf-8

# 4 space indentation
[*.{py,pyx}]
indent_style = space
indent_size = 4

# 2 space indentation
[*.{yaml,yml}]
indent_style = space
indent_size = 2
4 changes: 4 additions & 0 deletions docs/_newsfragments/2147.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Previously, importing :class:`~falcon.testing.TestCase` as a top-level
attribute in a test module could make ``pytest`` erroneously attempt to collect
its methods as test cases. This has now been prevented by adding a ``__test__``
attribute (set to ``False``) to the :class:`~falcon.testing.TestCase` class.
2 changes: 1 addition & 1 deletion falcon/forwarded.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Forwarded:
the proxy.
"""

# NOTE(kgriffs): Use "client" since "for" is a keyword, and
# NOTE(kgriffs): Use "src" since "for" is a keyword, and
# "scheme" instead of "proto" to be consistent with the
# falcon.Request interface.
__slots__ = ('src', 'dest', 'host', 'scheme')
Expand Down
3 changes: 3 additions & 0 deletions falcon/testing/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1970,6 +1970,9 @@ class TestClient:
"""

# NOTE(aryaniyaps): Prevent pytest from collecting tests on the class.
__test__ = False

def __init__(self, app, headers=None):
self.app = app
self._default_headers = headers
Expand Down
3 changes: 3 additions & 0 deletions falcon/testing/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def test_get_message(self):
self.assertEqual(result.json, doc)
"""

# NOTE(vytas): Here we have to restore __test__ to allow collecting tests!
__test__ = True

def setUp(self):
super(TestCase, self).setUp()

Expand Down

0 comments on commit a7f7008

Please sign in to comment.