summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/plugin/pytestplugin.py
diff options
context:
space:
mode:
authorHugo van Kemenade <hugovk@users.noreply.github.com>2022-01-06 12:14:33 -0500
committersqla-tester <sqla-tester@sqlalchemy.org>2022-01-06 12:14:33 -0500
commit0980de38a8144f6755aadf550a5c1077ce1a2416 (patch)
tree58335a5496af595deba7423cd4b07d673d708f5c /lib/sqlalchemy/testing/plugin/pytestplugin.py
parent21ee595ba9ef3e7abc8982fac7bf488c904cf9c9 (diff)
downloadsqlalchemy-0980de38a8144f6755aadf550a5c1077ce1a2416.tar.gz
Remove redundant code for EOL Python <= 3.6
<!-- Provide a general summary of your proposed changes in the Title field above --> ### Description <!-- Describe your changes in detail --> There's a few bits and pieces of code to support Python <= 3.6 which are no longer needed and can be removed, to slightly simplify the codebase. ### Checklist <!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once) --> This pull request is: - [ ] A documentation / typographical error fix - Good to go, no issue or tests are needed - [x] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. **Have a nice day!** Closes: #7544 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7544 Pull-request-sha: 282b4a91282902a57807aa2541b75b272b547127 Change-Id: I9ddf15fcf72551d52e3f027f337c7fee4aa9083b
Diffstat (limited to 'lib/sqlalchemy/testing/plugin/pytestplugin.py')
-rw-r--r--lib/sqlalchemy/testing/plugin/pytestplugin.py18
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py
index 8679a9f12..7a62ad008 100644
--- a/lib/sqlalchemy/testing/plugin/pytestplugin.py
+++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py
@@ -13,7 +13,6 @@ import itertools
import operator
import os
import re
-import sys
import pytest
@@ -528,13 +527,6 @@ def setup_test_methods(request):
# depending on the flags defined by the test class)
-def getargspec(fn):
- if sys.version_info.major == 3:
- return inspect.getfullargspec(fn)
- else:
- return inspect.getargspec(fn)
-
-
def _pytest_fn_decorator(target):
"""Port of langhelpers.decorator with pytest-specific tricks."""
@@ -611,12 +603,8 @@ class PytestFixtureFunctions(plugin_base.FixtureFunctions):
"""
from sqlalchemy.testing import exclusions
- if sys.version_info.major == 3:
- if len(arg_sets) == 1 and hasattr(arg_sets[0], "__next__"):
- arg_sets = list(arg_sets[0])
- else:
- if len(arg_sets) == 1 and hasattr(arg_sets[0], "next"):
- arg_sets = list(arg_sets[0])
+ if len(arg_sets) == 1 and hasattr(arg_sets[0], "__next__"):
+ arg_sets = list(arg_sets[0])
argnames = kw.pop("argnames", None)
@@ -711,7 +699,7 @@ class PytestFixtureFunctions(plugin_base.FixtureFunctions):
return fn
else:
if argnames is None:
- _argnames = getargspec(fn).args[1:]
+ _argnames = inspect.getfullargspec(fn).args[1:]
else:
_argnames = re.split(r", *", argnames)