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

bpo-30335: Add deprecation alias entry for assertNotRegexpMatches #1536

Merged
merged 4 commits into from
Jun 9, 2017
Merged

bpo-30335: Add deprecation alias entry for assertNotRegexpMatches #1536

merged 4 commits into from
Jun 9, 2017

Conversation

DimitrisJim
Copy link
Contributor

Adds assertNotRegexpMatches to the table of deprecated aliases and fixes some of the directives that failed to mention it.

@marco-buttu
Copy link
Contributor

@DimitrisJim I made a comment on bpo-30335. I think assertNotRegexpMatches has never been introduced.

@DimitrisJim
Copy link
Contributor Author

DimitrisJim commented May 10, 2017

Thanks, Marco! Yes, it looks like it was never introduced, you're not seeing it in 3.1 or 3.2 because it seems like it was forgotten; see how assertNotRegexpMatches was only renamed, it didn't get redefined as:

assertNotRegexpMatches = _deprecate(assertNotRegex) 

Then, It was added again at some point in 3.5.

When the name was added again in 3.5, the deprecation alias table wasn't updated, this the main reason for this PR. My only concern is with the change I made in the versionadded:: 3.1 directive. Judging from bpo10273 I thought it existed in 3.1 (this might need changing, though, I'm not sure how this should be handled)

@brettcannon brettcannon added the docs Documentation in the Doc dir label May 10, 2017
@brettcannon
Copy link
Member

@DimitrisJim I'm not seeing any change about versionadded; am I overlooking something?

@DimitrisJim
Copy link
Contributor Author

The diff for rst's is really bad on GitHub's review. I changed the versionadded by adding assertNotRegexpMatches too:

       .. versionadded:: 3.1
-         under the name ``assertRegexpMatches``.
+         under the names ``assertRegexpMatches`` and ``assertNotRegexpMatches``.

@marco-buttu
Copy link
Contributor

So, as far I can see, it has been introduced (and deprecated at the same time), in Python 3.5 :/

@brettcannon
Copy link
Member

It sounds like it came in under Python 3.5 (or was at least re-added). We should do the most accurate versionadded and state it for 3.5 (even if it was in 3.1, taken out later, and then put back into 3.5 for backwards-compatibility with 2.7).

@DimitrisJim
Copy link
Contributor Author

To make reviewing a bit easier, I reverted all changes except for the new table entry in deprecated aliases.

Under assertRegex and assertNotRegex I added an additional versionadded:

+      .. versionadded:: 3.5
+         The name ``assertNotRegexpMatches`` as a deprecated alias
+         for :meth:`.assertNotRegex`.

While, under the table for the deprecated aliases, I also added a deprecated directive:

+   .. deprecated:: 3.5
+         the ``assertNotRegexpMatches`` name in favor of :meth:`.assertNotRegex`.

@@ -1446,17 +1449,19 @@ along with their deprecated aliases:
:meth:`.assertAlmostEqual` failUnlessAlmostEqual assertAlmostEquals
:meth:`.assertNotAlmostEqual` failIfAlmostEqual assertNotAlmostEquals
:meth:`.assertRegex` assertRegexpMatches
:meth:`.assertNotRegex` assertNotRegexpMatches
Copy link
Contributor

@marco-buttu marco-buttu May 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assertNotRegexpMatches is not available for Python < 3.5, and we are saying that it has been deprecated in Python 3.2, when it was not available. IMHO we should not include this reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I changed that, after Brett's suggestion, to state it was introduced and deprecated at 3.5. It has to have an entry in this table so people who are porting testing code from 2 to 3 can see the new name for it.

@@ -1170,6 +1170,9 @@ Test cases
:meth:`.assertRegex`.
.. versionadded:: 3.2
:meth:`.assertNotRegex`.
.. versionadded:: 3.5
The name ``assertNotRegexpMatches`` as a deprecated alias
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"as a" -> "is a"

@brettcannon
Copy link
Member

Everything looks good now. It simply needs to be merged and backported.

@Mariatta Mariatta merged commit 74921ed into python:master Jun 9, 2017
@Mariatta
Copy link
Member

Mariatta commented Jun 9, 2017

Thanks for the PR @DimitrisJim 🎉

Mariatta pushed a commit to Mariatta/cpython that referenced this pull request Jun 10, 2017
…es (pythonGH-1536)

Document that assertNotRegexpMatches is a deprecated alias for assertNotRegex.
(cherry picked from commit 74921ed)
Mariatta pushed a commit to Mariatta/cpython that referenced this pull request Jun 10, 2017
…es (pythonGH-1536)

Document that assertNotRegexpMatches is a deprecated alias for assertNotRegex.
(cherry picked from commit 74921ed)
Mariatta added a commit that referenced this pull request Jun 10, 2017
…es (GH-1536) (GH-2055)

Document that assertNotRegexpMatches is a deprecated alias for assertNotRegex.
(cherry picked from commit 74921ed)
Mariatta added a commit that referenced this pull request Jun 10, 2017
…es (GH-1536) (GH-2056)

Document that assertNotRegexpMatches is a deprecated alias for assertNotRegex.
(cherry picked from commit 74921ed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants