Skip to content
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
46 changes: 23 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,40 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
name: Build and unit tests
runs-on: ubuntu-22.04
strategy:
matrix:
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
name: Build with Python ${{ matrix.python-version }}
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
container:
image: python:${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Checkout code
uses: actions/checkout@v3

- name: Upgrade pip and install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[gh]
- name: Test with tox
run: tox

- name: Run tests with tox
run: tox -e py$(echo "${{ matrix.python-version }}" | tr -d '.')
coverage:
name: Coverage report
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
container:
image: python:3.13
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: '3.11'
uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@ on:
jobs:
tests:
name: Integration tests
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
python-version:
- '3.6'
- '3.11'
- '3.12'
- '3.13'
container:
image: python:${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ tox

The tox tests include code style checks via pep8 and pylint.

The tox tests are configured to run on Python 3.6, 3.7, 3.8, 3.9, 3.10, 3.11.
The tox tests are configured to run on Python 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13.

# Questions, Bugs, and Feature Requests?

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
'Operating System :: POSIX',
Expand Down Expand Up @@ -62,7 +63,7 @@ def main():
redis_requires = ['redis>=2.10.3']
jwt_requires = ['pyjwt>=1.7.0', 'cryptography>=3']
coveralls_requires = ['coveralls']
dev_requires = ['tox<=3.28.0']
dev_requires = ['tox<=3.28.0', 'setuptools']
gh_requires = ['tox-gh-actions']
test_requires = [
'bottle',
Expand Down
4 changes: 2 additions & 2 deletions test/unit/object/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def test_update_contents_with_stream_does_preflight_check_if_specified(
test_file.update_contents_with_stream(**kwargs)

if preflight_check:
assert test_file.preflight_check.called_once_with(size=file_size)
test_file.preflight_check.assert_called_once_with(size=file_size)
if preflight_fails:
assert not mock_box_session.post.called
else:
Expand Down Expand Up @@ -508,7 +508,7 @@ def test_update_contents_does_preflight_check_if_specified(
test_file.update_contents(**kwargs)

if preflight_check:
assert test_file.preflight_check.called_once_with(size=file_size)
test_file.preflight_check.assert_called_once_with(size=file_size)
if preflight_fails:
assert not mock_box_session.post.called
else:
Expand Down
4 changes: 2 additions & 2 deletions test/unit/object/test_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def test_upload_stream_does_preflight_check_if_specified(
test_folder.upload_stream(**kwargs)

if preflight_check:
assert test_folder.preflight_check.called_once_with(size=file_size, name='foo.txt')
test_folder.preflight_check.assert_called_once_with(size=file_size, name='foo.txt')
_assert_post_called_correctly(mock_box_session, preflight_fails)
else:
assert not test_folder.preflight_check.called
Expand Down Expand Up @@ -439,7 +439,7 @@ def test_upload_does_preflight_check_if_specified(
test_folder.upload(**kwargs)

if preflight_check:
assert test_folder.preflight_check.called_once_with(size=file_size, name='foo.txt')
test_folder.preflight_check.assert_called_once_with(size=file_size, name='foo.txt')
_assert_post_called_correctly(mock_box_session, preflight_fails)
else:
assert not test_folder.preflight_check.called
Expand Down
4 changes: 2 additions & 2 deletions test/unit/session/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ def test_box_session_seeks_file_after_retry(box_session, mock_network_layer, ser
mock_file_2.tell.assert_called_with()
mock_file_1.seek.assert_called_with(0)
assert mock_file_1.seek.call_count == 2
assert mock_file_1.seek.has_calls(call(0) * 2)
mock_file_1.seek.assert_has_calls([call(0), call(0)])
mock_file_2.seek.assert_called_with(3)
assert mock_file_2.seek.call_count == 2
assert mock_file_2.seek.has_calls(call(3) * 2)
mock_file_2.seek.assert_has_calls([call(3), call(3)])


def test_box_session_raises_for_non_json_response(box_session, mock_network_layer, non_json_response, generic_successful_response, test_url):
Expand Down
6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ envlist =
py39,
py310,
py311,
py312,
py313,
coverage,
integration-tests

Expand All @@ -24,6 +26,8 @@ python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313

[testenv]
commands =
Expand All @@ -47,7 +51,7 @@ deps =
-rrequirements-test.txt

[testenv:coverage]
basepython = python3.11
basepython = python3.13
commands =
py.test --cov boxsdk --cov-report term-missing test/unit test/integration
deps =
Expand Down