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

[pull] master from Backblaze:master #212

Merged
merged 5 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
# Required
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/source/conf.py
Expand All @@ -14,7 +19,6 @@ formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.11
install:
- requirements: requirements.txt
- method: pip
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
* `--quiet` now will implicitly set `--noProgress` option as well
* pypy integration tests

### Infrastructure
* Use stable Python 3.12 in CI
* Fix readthedocs build by updating to v2 configuration schema

## [3.11.0] - 2023-10-04

Expand All @@ -20,7 +25,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Infrastructure
* Fix gathering licenses of typeshed libraries
* Fix spellcheck erroring out on LICENSE file
* Use stable Python 3.12 in CI

## [3.10.1] - 2023-09-27

Expand Down
19 changes: 18 additions & 1 deletion test/integration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,12 @@ def should_succeed(
assert any(p.match(line) for p in self.EXPECTED_STDERR_PATTERNS), \
f'Unexpected stderr line: {repr(line)}'

if platform.python_implementation().lower() == 'pypy':
# TODO: remove after pypy removes the leftover print and resolve
# https://github.com/Backblaze/B2_Command_Line_Tool/issues/936
while stdout.startswith('/'):
stdout = stdout.split('\n', 1)[-1]

if expected_pattern is not None:
assert re.search(expected_pattern, stdout), \
f'did not match pattern="{expected_pattern}", stdout="{stdout}"'
Expand All @@ -454,7 +460,12 @@ def should_succeed_json(self, args, additional_env: Optional[dict] = None):
if there was an error; otherwise, treats the stdout as JSON and returns
the data in it.
"""
return json.loads(self.should_succeed(args, additional_env=additional_env))
result = self.should_succeed(args, additional_env=additional_env)
try:
loaded_result = json.loads(result)
except json.JSONDecodeError:
raise ValueError(f'{result} is not a valid json')
return loaded_result

def should_fail(self, args, expected_pattern, additional_env: Optional[dict] = None):
"""
Expand All @@ -464,6 +475,12 @@ def should_fail(self, args, expected_pattern, additional_env: Optional[dict] = N
status, stdout, stderr = run_command(self.command, args, additional_env)
assert status != 0, 'ERROR: should have failed'

if platform.python_implementation().lower() == 'pypy':
# TODO: remove after pypy removes the leftover print and resolve
# https://github.com/Backblaze/B2_Command_Line_Tool/issues/936
while stdout.startswith('/'):
stdout = stdout.split('\n', 1)[-1]

assert re.search(expected_pattern, stdout + stderr), \
f'did not match pattern="{expected_pattern}", stdout="{stdout}", stderr="{stderr}"'

Expand Down
Loading