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

Tidy API and add tests for compat #204

Merged
merged 1 commit into from
Jul 9, 2019
Merged

Tidy API and add tests for compat #204

merged 1 commit into from
Jul 9, 2019

Conversation

adamchainz
Copy link
Contributor

  • Move 'text' into 'compat'
  • Add __all__ in api so it's clearer what is intended to be the public API
  • Flatten the two Context classes into one, since it's only part of the API and used there now
  • Use @classmethod instead of @staticmethod for Context, which is slightly more pythonic (even moreso would be a plain function)
  • Add tests for compat, and update implementation of datetime_to_timestamp to be consistent on both Pythons 2 and 3
  • Rewrite API tests to use tracked_request fixture and thus be smaller

@adamchainz adamchainz requested review from cschneid and dlanderson July 2, 2019 09:35
@adamchainz adamchainz force-pushed the flatten_context branch 2 times, most recently from a72d959 to 890617f Compare July 4, 2019 09:03
Copy link
Contributor

@dlanderson dlanderson left a comment

Choose a reason for hiding this comment

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

LGTM

* Move 'text' into 'compat'
* Add `__all__` in `api` so it's clearer what is intended to be the public API
* Flatten the two Context classes into one, since it's only part of the API and used there now
* Use `@classmethod` instead of `@staticmethod` for `Context`, which is slightly more pythonic (even moreso would be a plain function)
* Add tests for compat, and update implementation of `datetime_to_timestamp` to be consistent on both Pythons 2 and 3
* Rewrite API tests to use `tracked_request` fixture and thus be smaller
@adamchainz adamchainz merged commit 1f54da4 into master Jul 9, 2019
@adamchainz adamchainz deleted the flatten_context branch July 9, 2019 21:45
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.

2 participants