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

HYGIENE: Using assertIsInstance, assertIs, assertIsNone, assertIsNotNone when relevant #2364

Merged
merged 9 commits into from
Sep 20, 2016

Commits on Sep 20, 2016

  1. Replacing assertTrue(isinstance(...)) with assertIsInstance.

    Did this using: https://gist.github.com/dhermes/57e29d96b17a4e1543b47bd2fcebfc07
    
    NOTE: Some usage that span multiple lines are still not changed.
    dhermes committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    b990bfa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    944e58d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    66ea44d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    67d0385 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d07db3c View commit details
    Browse the repository at this point in the history
  6. Replacing remaining assertTrue(... is ...) with assertIs(..., ...).

    Done manually by checking the output of:
    
    $ git grep ' is$' -- unit_tests/
    $ git grep ' is$' -- system_tests/
    $ git grep ' is ' -- unit_tests/
    $ git grep ' is ' -- system_tests/
    dhermes committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    24aa6e7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3f06350 View commit details
    Browse the repository at this point in the history
  8. Replacing assertEqual(..., None) with assertIsNone(...).

    Did this using: https://gist.github.com/dhermes/f4176452c2436b14e0c97a114d98bace
    
    Also had to manually undo a few of the changes since the regex
    matched things like
    
    self.assertEqual(foo, [(value, has_some, parens, None)])
    dhermes committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    2c273f0 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    206045f View commit details
    Browse the repository at this point in the history