Compare commits

...

No commits in common. 'f38' and 'c8-stream-2.7' have entirely different histories.

14
.gitignore vendored

@ -1,13 +1 @@
nose-0.11.3.tar.gz
nose-0.11.4.tar.gz
/nose-1.0.0.tar.gz
/nose-1.1.1.tar.gz
/nose-1.1.2.tar.gz
/nose-1.2.0.tar.gz
/nose-1.2.1.tar.gz
/nose-1.3.0.tar.gz
/nose-1.3.1.tar.gz
/nose-1.3.2.tar.gz
/nose-1.3.4.tar.gz
/nose-1.3.6.tar.gz
/nose-1.3.7.tar.gz
SOURCES/nose-1.3.7.tar.gz

@ -0,0 +1 @@
97f2a04c9d43b29ddf4794a1a1d1ba803f1074c6 SOURCES/nose-1.3.7.tar.gz

@ -1,12 +1,41 @@
%bcond_without python3
%bcond_with python36_module
%global modname nose
# Enable building without docs to avoid a circular dependency between this and python-sphinx
#
# Docs disabled permanently because the docs build config is not ported to
# Python 3 and thus cannot be built with Python 3 version of Sphinx.
%bcond_with docs
# python2X and python3X are built form the same module, so we need a conditional for python2 bits
# the state of the conditional is not important in the spec, it is set in modulemd
%bcond_with python2
%global desc nose extends the test loading and running features of unit test, making\
it easier to write, find and run tests.\
\
By default, nose will run tests in files or directories under the\
current working directory whose names include "test" or "Test" at a\
word boundary (like "test_this" or "functional_test" or "TestClass"\
but not "libtest"). Test output is similar to that of unit test, but\
also includes captured stdout output from failing tests, for easy\
print-style debugging.\
\
These features, and many more, are customizable through the use of\
plugins. Plugins included with nose provide support for doctest, code\
coverage and profiling, flexible attribute-based test selection,\
output capture and more.\
Name: python-%{modname}
Version: 1.3.7
Release: 40%{?dist}
Release: 31%{?dist}
BuildArch: noarch
License: LGPLv2+ and Public Domain
Summary: Deprecated test runner for Python
Summary: Discovery-based unit test extension for Python
URL: https://nose.readthedocs.org/en/latest/
Source0: http://pypi.python.org/packages/source/n/nose/nose-%{version}.tar.gz
# Make compatible with coverage 4.1
@ -24,157 +53,245 @@ Patch3: python-nose-readunicode.patch
# Python now returns ModuleNotFoundError instead of the previous ImportError
# https://github.com/nose-devs/nose/pull/1029
Patch4: python-nose-py36.patch
# Remove a SyntaxWarning (other projects may treat it as error)
Patch5: python-nose-py38.patch
# Remove use_2to3 from setuptools.setup() call
# We call the command line tool in %%prep instead
# https://fedoraproject.org/wiki/Changes/Setuptools_58+
Patch6: python-nose-no-use_2to3.patch
# Import unittest.TextTestResult instead of removed unittest._TextTestResult
# Use ConfigParser.read_file() instead of .readfp()
# Adapt test_xunit to tracebacks/exceptions with ^^^^^^^^ lines
# Migrate from removed inspect.getargspec() to inspect.getfullargspec()
Patch7: python-nose-py311.patch
# Adapt doctest to new tracebacks/exceptions on Python 3.11+
Patch311: python-nose-py311-doctest.patch
BuildRequires: dos2unix
%global _description %{expand:
A deprecated test runner for Python.
%description
%{desc}
See https://fedoraproject.org/wiki/Changes/DeprecateNose}
%package docs
Summary: Nose Documentation
%if %{with python3}
%if %{with docs}
BuildRequires: %{_bindir}/sphinx-build-3
%endif
%endif
%description %_description
%description docs
Documentation for Nose.
%if %{with python2}
%package -n python2-%{modname}
Summary: %{summary}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-coverage >= 3.4-1
Requires: python2-setuptools
%{?python_provide:%python_provide python2-%{modname}}
%description -n python2-%{modname}
%{desc}
%endif
%if %{with python3}
%package -n python3-%{modname}
Summary: %{summary}
%if %{with python36_module}
BuildRequires: python36-devel
BuildRequires: python36-rpm-macros
%else
BuildRequires: python3-devel
BuildRequires: /usr/bin/2to3
%endif
BuildRequires: python3-setuptools
BuildRequires: python3-coverage >= 3.4-1
# Require alternatives version that implements the --keep-foreign flag
Requires(postun): alternatives >= 1.19.1-1
# For alternatives
Requires: python36
Requires(post): python36
Requires(postun): python36
Requires: python3-setuptools
%{?python_provide:%python_provide python3-%{modname}}
Conflicts: python-%{modname} < %{version}-%{release}
Obsoletes: python-%{modname}-docs < 1.3.7-30
Obsoletes: platform-python-%{modname} < %{version}-%{release}
# This package is deprecated, no new packages in Fedora can depend on it
# https://fedoraproject.org/wiki/Changes/DeprecateNose
# Contact the change owners for help migrating to pytest
Provides: deprecated()
%description -n python3-%{modname}
%{desc}
%description -n python3-%{modname} %_description
%prep
%autosetup -N -n %{modname}-%{version}
# apply all patches up until number 300
%autopatch -p1 -M 300
%if v"0%{?python3_version}" >= v"3.11"
%patch311 -p1
This package installs the nose module and nosetests3 program that can discover
python3 unit tests.
%endif
%prep
%setup -qc
pushd %{modname}-%{version}
%autopatch -p1
dos2unix examples/attrib_plugin.py
cp -pr lgpl.txt AUTHORS CHANGELOG examples NEWS README.txt ..
popd
%if %{with python3}
mv %{modname}-%{version} python3
%endif
%if %{with python2}
mv %{modname}-%{version} python2
%endif
%build
2to3 %{?_smp_mflags} --write --nobackups --no-diffs .
2to3 %{?_smp_mflags} --write --nobackups --no-diffs -d $(find -name '*.rst')
%if %{with python2}
pushd python2
%py2_build
popd
%endif
%if %{with python3}
pushd python3
%py3_build
popd
%endif
%install
mkdir -p %{buildroot}%{_mandir}/man1
%if %{with python2}
pushd python2
%py2_install
mv %{buildroot}%{_bindir}/nosetests{,-%{python2_version}}
ln -sf nosetests-%{python2_version} %{buildroot}%{_bindir}/nosetests-2
mv %{buildroot}%{_prefix}/man/man1/nosetests.1 %{buildroot}%{_mandir}/man1/nosetests-%{python2_version}.1
ln -sf nosetests-%{python2_version}.1 %{buildroot}%{_mandir}/man1/nosetests-2.1
popd
%endif
%if %{with python3}
pushd python3
%py3_install
mv %{buildroot}%{_bindir}/nosetests{,-%{python3_version}}
ln -sf nosetests-%{python3_version} %{buildroot}%{_bindir}/nosetests-3
touch %{buildroot}%{_bindir}/nosetests-3 # for alternatives
mv %{buildroot}%{_prefix}/man/man1/nosetests.1 %{buildroot}%{_mandir}/man1/nosetests-%{python3_version}.1
ln -sf nosetests-%{python3_version}.1 %{buildroot}%{_mandir}/man1/nosetests-3.1
ln -sf nosetests-3 %{buildroot}%{_bindir}/nosetests
ln -sf nosetests-3.1 %{buildroot}%{_mandir}/man1/nosetests.1
touch %{buildroot}%{_mandir}/man1/nosetests-3.1 # for alternatives
popd
%endif
%if %{with python2}
ln -sf nosetests-2.1 %{buildroot}%{_mandir}/man1/nosetests.1
%endif
%if %{with python3}
%if %{with docs}
pushd python3/doc
sphinx-build-3 -b html -d .build/doctrees . .build/html
rm -vrf .build/html/.buildinfo .build/html/_sources
mv .build/html ../..
rm -vrf .build
popd
%endif
cp -a python3/doc reST
rm -vrf reST/{.static,.templates}
%endif
%check
%if %{with python2}
pushd python2
%{__python2} selftest.py
popd
%endif
%if %{with python3}
pushd python3
%{__python3} setup.py build_tests
%{__python3} selftest.py
popd
%endif
%if %{with python3}
%post -n python3-%{modname}
alternatives --add-slave python3 %{_bindir}/python%{python3_version} \
%{_bindir}/nosetests-3 \
nosetests-3 \
%{_bindir}/nosetests-%{python3_version}
alternatives --add-slave python3 %{_bindir}/python%{python3_version} \
%{_mandir}/man1/nosetests-3.1.gz \
nosetests-3-man \
%{_mandir}/man1/nosetests-%{python3_version}.1.gz
%postun -n python3-%{modname}
if [ $1 -eq 0 ]; then
alternatives --keep-foreign --remove-slave python3 \
%{_bindir}/python%{python3_version} nosetests-3
alternatives --keep-foreign --remove-slave python3 \
%{_bindir}/python%{python3_version} nosetests-3-man
fi
%endif
%if %{with python2}
%files -n python2-%{modname}
%license lgpl.txt
%{_bindir}/nosetests-2
%{_bindir}/nosetests-%{python2_version}
%{_mandir}/man1/nosetests.1*
%{_mandir}/man1/nosetests-2.1*
%{_mandir}/man1/nosetests-%{python2_version}.1*
%{python2_sitelib}/nose-*.egg-info/
%{python2_sitelib}/nose/
%endif
%if %{with python3}
%files -n python3-%{modname}
%license lgpl.txt
%doc AUTHORS CHANGELOG NEWS README.txt
%{_bindir}/nosetests
%{_bindir}/nosetests-3
%ghost %{_bindir}/nosetests-3
%{_bindir}/nosetests-%{python3_version}
%{_mandir}/man1/nosetests.1*
%{_mandir}/man1/nosetests-3.1*
%ghost %{_mandir}/man1/nosetests-3.1*
%{_mandir}/man1/nosetests-%{python3_version}.1*
%{python3_sitelib}/nose-*.egg-info/
%{python3_sitelib}/nose/
%endif
%changelog
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-40
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-39
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1.3.7-38
- Rebuilt for Python 3.11
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-37
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Mon Nov 01 2021 Miro Hrončok <mhroncok@redhat.com> - 1.3.7-36
- Fix build with setuptools 58+
- Fixes rhbz#2018972
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-35
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Jun 02 2021 Python Maint <python-maint@redhat.com> - 1.3.7-34
- Rebuilt for Python 3.10
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
%files docs
%license lgpl.txt
%doc AUTHORS CHANGELOG examples NEWS README.txt
%if %{with python3}
%if %{with docs}
%doc html reST
%endif # with docs
%endif # with python3
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 1.3.7-31
- Rebuilt for Python 3.9
%changelog
* Fri Jul 30 2021 Tomas Orsava <torsava@redhat.com> - 1.3.7-31
- Adjusted the postun scriptlets to enable upgrading to RHEL 9
- Resolves: rhbz#1933055
* Fri Jan 31 2020 Miro Hrončok <mhroncok@redhat.com> - 1.3.7-30
- Deprecate the package
https://fedoraproject.org/wiki/Changes/DeprecateNose
- Drop the docs subpackage
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 1.3.7-30
- Bumping due to problems with modular RPM upgrade path
- Resolves: rhbz#1695587
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Oct 04 2018 Lumír Balhar <lbalhar@redhat.com> - 1.3.7-29
- Fix alternatives - post and postun sections only with python3
- Resolves: rhbz#1633534
* Fri Nov 15 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.7-28
- Subpackage python2-nose has been removed
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
* Tue Oct 02 2018 Lumír Balhar <lbalhar@redhat.com> - 1.3.7-28
- Add alternatives for the executable and manpage
- Resolves: rhbz#1633534
* Thu Oct 31 2019 Petr Viktorin <pviktori@redhat.com> - 1.3.7-27
- Remove build dependency on python2-coverage
Don't test coverage plugin on Python 2
* Wed Aug 15 2018 Lumír Balhar <lbalhar@redhat.com> - 1.3.7-27
- Remove nosetest-3 executable/manpage. This will be provided by python3 module.
- Resolves: rhbz#1615727
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.7-26
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Wed Aug 08 2018 Lumír Balhar <lbalhar@redhat.com> - 1.3.7-26
- Remove unversioned binaries from python2 subpackage
- Resolves: rhbz#1613343
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.7-25
- Rebuilt for Python 3.8
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 1.3.7-25
- Make possible to disable python3 subpackage
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Jul 18 2018 Tomas Orsava <torsava@redhat.com> - 1.3.7-24
- BuildRequire also python36-rpm-macros as part of the python36 module build
* Mon Jul 22 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.7-23
- Make /usr/bin/nosetests Python 3
* Wed Jul 04 2018 Miro Hrončok <mhroncok@redhat.com> - 1.3.7-23
- Add a bcond for python2
- Build docs with python3 explicitly
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Jun 26 2018 Tomas Orsava <torsava@redhat.com> - 1.3.7-22
- Use python2 macros instead of unversioned python macros
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jun 18 2018 Tomas Orsava <torsava@redhat.com> - 1.3.7-21
- Disabled docs because the docs build config is not ported to Python 3 and
thus cannot be built with Python 3 version of Sphinx
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 1.3.7-20
- Rebuilt for Python 3.7
* Mon Apr 30 2018 Tomas Orsava <torsava@redhat.com> - 1.3.7-20
- Require the python36-devel package when building for the python36 module
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

@ -1,53 +0,0 @@
diff --git a/setup.py b/setup.py
index a2091c0..7e01bba 100644
--- a/setup.py
+++ b/setup.py
@@ -13,8 +13,7 @@ if sys.version_info >= (3,):
from distribute_setup import use_setuptools
use_setuptools()
- extra = {'use_2to3': True,
- 'test_dirs': test_dirs,
+ extra = {'test_dirs': test_dirs,
'test_build_dir': 'build/tests',
'pyversion_patching': True,
}
diff --git a/setup3lib.py b/setup3lib.py
index 27bdb93..761b74f 100644
--- a/setup3lib.py
+++ b/setup3lib.py
@@ -18,7 +18,6 @@ else:
import logging
from setuptools import Distribution as _Distribution
from distutils.core import Command
- from setuptools.command.build_py import Mixin2to3
from distutils import dir_util, file_util, log
import setuptools.command.test
from pkg_resources import normalize_path
@@ -68,7 +67,7 @@ else:
self.pyversion_patching = False
_Distribution.__init__(self, attrs)
- class BuildTestsCommand (Command, Mixin2to3):
+ class BuildTestsCommand (Command):
# Create mirror copy of tests, convert all .py files using 2to3
user_options = []
@@ -83,7 +82,6 @@ else:
self.test_base = test_base
def run(self):
- use_2to3 = getattr(self.distribution, 'use_2to3', False)
test_dirs = getattr(self.distribution, 'test_dirs', [])
test_base = self.test_base
bpy_cmd = self.get_finalized_command("build_py")
@@ -112,9 +110,6 @@ else:
if fn.endswith(ext):
doc_modified.append(dstfile)
break
- if use_2to3:
- self.run_2to3(py_modified)
- self.run_2to3(doc_modified, True)
if self.distribution.pyversion_patching:
if patch is not None:
for file in modified:

@ -1,56 +0,0 @@
diff --git a/functional_tests/doc_tests/test_issue145/imported_tests.rst b/functional_tests/doc_tests/test_issue145/imported_tests.rst
index c4eee78..caad752 100644
--- a/functional_tests/doc_tests/test_issue145/imported_tests.rst
+++ b/functional_tests/doc_tests/test_issue145/imported_tests.rst
@@ -42,11 +42,11 @@ imported, not the source modules.
>>> argv = [__file__, '-v', support]
>>> run(argv=argv) # doctest: +REPORT_NDIFF
package1 setup
- test (package1.test_module.TestCase) ... ok
+ test (package1.test_module.TestCase.test) ... ok
package1.test_module.TestClass.test_class ... ok
package1.test_module.test_function ... ok
package2c setup
- test (package2c.test_module.TestCase) ... ok
+ test (package2c.test_module.TestCase.test) ... ok
package2c.test_module.TestClass.test_class ... ok
package2f setup
package2f.test_module.test_function ... ok
@@ -71,7 +71,7 @@ packages are executed.
>>> argv = [__file__, '-v', os.path.join(support, 'package2c')]
>>> run(argv=argv) # doctest: +REPORT_NDIFF
package2c setup
- test (package2c.test_module.TestCase) ... ok
+ test (package2c.test_module.TestCase.test) ... ok
package2c.test_module.TestClass.test_class ... ok
<BLANKLINE>
----------------------------------------------------------------------
@@ -98,7 +98,7 @@ command-line.
... ':TestCase.test']
>>> run(argv=argv) # doctest: +REPORT_NDIFF
package2c setup
- test (package2c.test_module.TestCase) ... ok
+ test (package2c.test_module.TestCase.test) ... ok
<BLANKLINE>
----------------------------------------------------------------------
Ran 1 test in ...s
diff --git a/functional_tests/doc_tests/test_selector_plugin/selector_plugin.rst b/functional_tests/doc_tests/test_selector_plugin/selector_plugin.rst
index f5f7913..5463cf1 100644
--- a/functional_tests/doc_tests/test_selector_plugin/selector_plugin.rst
+++ b/functional_tests/doc_tests/test_selector_plugin/selector_plugin.rst
@@ -108,10 +108,10 @@ Now we can execute a test run using the custom selector, and the
project's tests will be collected.
>>> run(argv=argv, plugins=[UseMySelector()])
- test_add (basic.TestBasicMath) ... ok
- test_sub (basic.TestBasicMath) ... ok
- test_tuple_groups (my_function.MyFunction) ... ok
- test_cat (cat.StringsCat) ... ok
+ test_add (basic.TestBasicMath.test_add) ... ok
+ test_sub (basic.TestBasicMath.test_sub) ... ok
+ test_tuple_groups (my_function.MyFunction.test_tuple_groups) ... ok
+ test_cat (cat.StringsCat.test_cat) ... ok
<BLANKLINE>
----------------------------------------------------------------------
Ran 4 tests in ...s

@ -1,203 +0,0 @@
diff --git a/functional_tests/test_attribute_plugin.py b/functional_tests/test_attribute_plugin.py
index c9bab66..df2cfd3 100644
--- a/functional_tests/test_attribute_plugin.py
+++ b/functional_tests/test_attribute_plugin.py
@@ -150,7 +150,10 @@ class TestClassAndMethodAttrs(AttributePluginTester):
args = ["-a", "meth_attr=method,cls_attr=class"]
def verify(self):
- assert '(test_attr.TestClassAndMethodAttrs) ... ok' in self.output
+ if sys.version_info >= (3, 11):
+ assert '(test_attr.TestClassAndMethodAttrs.test_method) ... ok' in self.output
+ else:
+ assert '(test_attr.TestClassAndMethodAttrs) ... ok' in self.output
assert 'test_case_two' not in self.output
assert 'test_case_one' not in self.output
assert 'test_case_three' not in self.output
@@ -166,7 +169,10 @@ class TestTopLevelNotSelected(AttributePluginTester):
# rather than the attribute plugin, but the issue more easily manifests
# itself when using attributes.
assert 'test.test_b ... ok' in self.output
- assert 'test_a (test.TestBase) ... ok' in self.output
+ if sys.version_info >= (3, 11):
+ assert 'test_a (test.TestBase.test_a) ... ok' in self.output
+ else:
+ assert 'test_a (test.TestBase) ... ok' in self.output
assert 'TestDerived' not in self.output
diff --git a/functional_tests/test_load_tests_from_test_case.py b/functional_tests/test_load_tests_from_test_case.py
index 13d0c8a..934d43b 100644
--- a/functional_tests/test_load_tests_from_test_case.py
+++ b/functional_tests/test_load_tests_from_test_case.py
@@ -2,6 +2,7 @@
Tests that plugins can override loadTestsFromTestCase
"""
import os
+import sys
import unittest
from nose import loader
from nose.plugins import PluginTester
@@ -44,9 +45,14 @@ class TestLoadTestsFromTestCaseHook(PluginTester, unittest.TestCase):
suitepath = os.path.join(support, 'ltftc')
def runTest(self):
- expect = [
- 'test_value (%s.Derived) ... ERROR' % __name__,
- 'test_value (tests.Tests) ... ok']
+ if sys.version_info >= (3, 11):
+ expect = [
+ 'test_value (%s.Derived.test_value) ... ERROR' % __name__,
+ 'test_value (tests.Tests.test_value) ... ok']
+ else:
+ expect = [
+ 'test_value (%s.Derived) ... ERROR' % __name__,
+ 'test_value (tests.Tests) ... ok']
print str(self.output)
for line in self.output:
if expect:
diff --git a/functional_tests/test_xunit.py b/functional_tests/test_xunit.py
index 6c2e99d..6e76a7d 100644
--- a/functional_tests/test_xunit.py
+++ b/functional_tests/test_xunit.py
@@ -25,7 +25,10 @@ class TestXUnitPlugin(PluginTester, unittest.TestCase):
assert "ERROR: test_error" in self.output
assert "FAIL: test_fail" in self.output
- assert "test_skip (test_xunit_as_suite.TestForXunit) ... SKIP: skipit" in self.output
+ if sys.version_info >= (3, 11):
+ assert "test_skip (test_xunit_as_suite.TestForXunit.test_skip) ... SKIP: skipit" in self.output
+ else:
+ assert "test_skip (test_xunit_as_suite.TestForXunit) ... SKIP: skipit" in self.output
assert "XML: %s" % xml_results_filename in self.output
f = codecs.open(xml_results_filename,'r', encoding='utf8')
diff --git a/nose/config.py b/nose/config.py
index ad01e61..d9aec2d 100644
--- a/nose/config.py
+++ b/nose/config.py
@@ -78,7 +78,7 @@ class ConfiguredDefaultsOptionParser(object):
except AttributeError:
filename = '<???>'
try:
- cfg.readfp(fh)
+ cfg.read_file(fh)
except ConfigParser.Error, exc:
raise ConfigError("Error reading config file %r: %s" %
(filename, str(exc)))
diff --git a/nose/plugins/errorclass.py b/nose/plugins/errorclass.py
index d1540e0..38ecec9 100644
--- a/nose/plugins/errorclass.py
+++ b/nose/plugins/errorclass.py
@@ -1,4 +1,15 @@
+import sys
+
+if sys.version_info >= (3, 11):
+ method = "TestTodo.runTest"
+ traceback = """
+...Todo("I need to test something")
+...
"""
+else:
+ method = "TestTodo"
+ traceback = ""
+f"""
ErrorClass Plugins
------------------
@@ -66,7 +77,7 @@ each step.
Now run the test. TODO is printed.
>>> _ = case(result) # doctest: +ELLIPSIS
- runTest (....TestTodo) ... TODO: I need to test something
+ runTest (....{method}) ... TODO: I need to test something
Errors and failures are empty, but todo has our test:
@@ -79,10 +90,10 @@ Errors and failures are empty, but todo has our test:
>>> result.printErrors() # doctest: +ELLIPSIS
<BLANKLINE>
======================================================================
- TODO: runTest (....TestTodo)
+ TODO: runTest (....{method})
----------------------------------------------------------------------
Traceback (most recent call last):
- ...
+ ...{traceback}
...Todo: I need to test something
<BLANKLINE>
diff --git a/nose/plugins/manager.py b/nose/plugins/manager.py
index 4d2ed22..daa9edb 100644
--- a/nose/plugins/manager.py
+++ b/nose/plugins/manager.py
@@ -105,7 +105,7 @@ class PluginProxy(object):
meth = getattr(plugin, call, None)
if meth is not None:
if call == 'loadTestsFromModule' and \
- len(inspect.getargspec(meth)[0]) == 2:
+ len(inspect.getfullargspec(meth)[0]) == 2:
orig_meth = meth
meth = lambda module, path, **kwargs: orig_meth(module)
self.plugins.append((plugin, meth))
diff --git a/nose/result.py b/nose/result.py
index f974a14..228a42c 100644
--- a/nose/result.py
+++ b/nose/result.py
@@ -13,7 +13,7 @@ try:
# 2.7+
from unittest.runner import _TextTestResult
except ImportError:
- from unittest import _TextTestResult
+ from unittest import TextTestResult as _TextTestResult
from nose.config import Config
from nose.util import isclass, ln as _ln # backwards compat
diff --git a/nose/util.py b/nose/util.py
index 80ab1d4..21770ae 100644
--- a/nose/util.py
+++ b/nose/util.py
@@ -449,15 +449,15 @@ def try_run(obj, names):
if type(obj) == types.ModuleType:
# py.test compatibility
if isinstance(func, types.FunctionType):
- args, varargs, varkw, defaults = \
- inspect.getargspec(func)
+ args, varargs, varkw, defaults, *_ = \
+ inspect.getfullargspec(func)
else:
# Not a function. If it's callable, call it anyway
if hasattr(func, '__call__') and not inspect.ismethod(func):
func = func.__call__
try:
- args, varargs, varkw, defaults = \
- inspect.getargspec(func)
+ args, varargs, varkw, defaults, *_ = \
+ inspect.getfullargspec(func)
args.pop(0) # pop the self off
except TypeError:
raise TypeError("Attribute %s of %r is not a python "
diff --git a/unit_tests/test_xunit.py b/unit_tests/test_xunit.py
index 2a9f69b..560b9c2 100644
--- a/unit_tests/test_xunit.py
+++ b/unit_tests/test_xunit.py
@@ -134,7 +134,8 @@ class TestXMLOutputWithXML(unittest.TestCase):
err_lines = err.text.strip().split("\n")
eq_(err_lines[0], 'Traceback (most recent call last):')
eq_(err_lines[-1], 'AssertionError: one is not \'equal\' to two')
- eq_(err_lines[-2], ' raise AssertionError("one is not \'equal\' to two")')
+ r_line = -3 if '^' * 10 in err_lines[-2] else -2
+ eq_(err_lines[r_line], ' raise AssertionError("one is not \'equal\' to two")')
else:
# this is a dumb test for 2.4-
assert '<?xml version="1.0" encoding="UTF-8"?>' in result
@@ -201,7 +202,8 @@ class TestXMLOutputWithXML(unittest.TestCase):
err_lines = err.text.strip().split("\n")
eq_(err_lines[0], 'Traceback (most recent call last):')
eq_(err_lines[-1], 'RuntimeError: some error happened')
- eq_(err_lines[-2], ' raise RuntimeError("some error happened")')
+ r_line = -3 if '^' * 10 in err_lines[-2] else -2
+ eq_(err_lines[r_line], ' raise RuntimeError("some error happened")')
else:
# this is a dumb test for 2.4-
assert '<?xml version="1.0" encoding="UTF-8"?>' in result

@ -1,62 +0,0 @@
diff --git a/nose/config.py b/nose/config.py
index 125eb55..ad01e61 100644
--- a/nose/config.py
+++ b/nose/config.py
@@ -139,7 +139,7 @@ class ConfiguredDefaultsOptionParser(object):
class Config(object):
- """nose configuration.
+ r"""nose configuration.
Instances of Config are used throughout nose to configure
behavior, including plugin lists. Here are the default values for
diff --git a/nose/ext/dtcompat.py b/nose/ext/dtcompat.py
index 332cf08..b5698c5 100644
--- a/nose/ext/dtcompat.py
+++ b/nose/ext/dtcompat.py
@@ -683,7 +683,7 @@ class DocTestParser:
# This regular expression finds the indentation of every non-blank
# line in a string.
- _INDENT_RE = re.compile('^([ ]*)(?=\S)', re.MULTILINE)
+ _INDENT_RE = re.compile(r'^([ ]*)(?=\S)', re.MULTILINE)
def _min_indent(self, s):
"Return the minimum indentation of any non-blank line in `s`"
@@ -1018,7 +1018,7 @@ class DocTestFinder:
if lineno is not None:
if source_lines is None:
return lineno+1
- pat = re.compile('(^|.*:)\s*\w*("|\')')
+ pat = re.compile(r'(^|.*:)\s*\w*("|\')')
for lineno in range(lineno, len(source_lines)):
if pat.match(source_lines[lineno]):
return lineno
@@ -1427,11 +1427,11 @@ class OutputChecker:
# blank line, unless the DONT_ACCEPT_BLANKLINE flag is used.
if not (optionflags & DONT_ACCEPT_BLANKLINE):
# Replace <BLANKLINE> in want with a blank line.
- want = re.sub('(?m)^%s\s*?$' % re.escape(BLANKLINE_MARKER),
+ want = re.sub(r'(?m)^%s\s*?$' % re.escape(BLANKLINE_MARKER),
'', want)
# If a line in got contains only spaces, then remove the
# spaces.
- got = re.sub('(?m)^\s*?$', '', got)
+ got = re.sub(r'(?m)^\s*?$', '', got)
if got == want:
return True
diff --git a/nose/inspector.py b/nose/inspector.py
index a6c4a3e..ad22c0c 100644
--- a/nose/inspector.py
+++ b/nose/inspector.py
@@ -107,7 +107,7 @@ def tbsource(tb, context=6):
def find_inspectable_lines(lines, pos):
- """Find lines in home that are inspectable.
+ r"""Find lines in home that are inspectable.
Walk back from the err line up to 3 lines, but don't walk back over
changes in indent level.

@ -1 +0,0 @@
4d3ad0ff07b61373d2cefc89c5d0b20b nose-1.3.7.tar.gz
Loading…
Cancel
Save