Skip to content

Conversation

@mwbenowitz
Copy link
Contributor

This silences the PyYAML load warning on invocation. The warning (and options for silencing/correcting it) is described here: PyYAML yaml.load.

Implementing full_load still allows for the full set of yaml syntax.

Additionally this adds a new test case for the read helper that uses the loader and a minor fix the the other a failing unit test.

Replaces the deprecated pyyaml `load` method with the `full_load`
method, which prevents arbitrary code execution. Includes a test
suite for the `read` helper method.
The test for the `get_remaining_time_in_millis` method was
evaluating the output against a count in seconds, not milliseconds.
This corrects the issue to allow the test suite to pass
AWS only supports python2.7+ (technically only 2.7 & 3.6).
Additionally PyYAML does not support 2.6 which will cause failures
in any case.
@mwbenowitz
Copy link
Contributor Author

After some changes to the travisCI config and requirements this passes, but perhaps these changes would be better made in a different branch. The changes to the the config are:

  • Removal of Python 2.6 from the .travis.yml file as it is not supported by PyYAML or by AWS Lambda.
  • Setting the pytest requirement to >=3.6 in dev_requirements.txt to ensure compatibility with pytest-cov in the travisCI environment. For most versions it does not include the necessary version, which leads to failing tests.
  • Removed a new test I added as it included an assertion that failed in Python 2.7

@w00kie w00kie mentioned this pull request Jun 6, 2019
@franciscohanna92
Copy link
Contributor

@nficano Please merge this PR!

@luisaverdes luisaverdes self-requested a review August 25, 2019 19:35
@luisaverdes luisaverdes merged commit 3db748d into nficano:master Aug 25, 2019
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.

4 participants