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

Adding a compatibility shim for assertRaisesRegex #79

Merged
merged 1 commit into from
Feb 3, 2020

Conversation

jsiirola
Copy link
Contributor

@jsiirola jsiirola commented Feb 2, 2020

Fixes: Pyomo/pyomo#1283

Summary/Motivation:

assertRaisesRegexp was added in Python 3.2 and now issues a deprecation warning beginning in Python 3.8. This adds a definition of assertRaisesRegex to the pyutilib unittest wrapper in Python 2.

Changes proposed in this PR:

  • define assertRaisesRegex in Python 2.

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

AssertRaisesRegexp issues a deprecation warning beginning in Python 3.8.
@jsiirola jsiirola requested a review from blnicho February 2, 2020 23:55
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 61.039% when pulling da2f6ae on unittest-compat into 5964c9c on master.

@codecov-io
Copy link

codecov-io commented Feb 3, 2020

Codecov Report

Merging #79 into master will increase coverage by 0.17%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #79      +/-   ##
==========================================
+ Coverage    62.9%   63.07%   +0.17%     
==========================================
  Files          87       87              
  Lines        8807     8783      -24     
==========================================
  Hits         5540     5540              
+ Misses       3267     3243      -24
Impacted Files Coverage Δ
pyutilib/th/pyunit.py 47.13% <0%> (-0.32%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5964c9c...da2f6ae. Read the comment docs.

@blnicho blnicho changed the title Adding a compatibility shim for assertRaisesRexgex Adding a compatibility shim for assertRaisesRegex Feb 3, 2020
@blnicho blnicho merged commit 6591015 into master Feb 3, 2020
@blnicho blnicho deleted the unittest-compat branch February 3, 2020 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request: add assertRaisesRegex support to TestCase
5 participants