Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: CleanCut/green
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.3.0
Choose a base ref
...
head repository: CleanCut/green
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Jan 12, 2022

  1. Copy the full SHA
    e35cd61 View commit details
  2. bump to 3.4.0

    CleanCut committed Jan 12, 2022
    Copy the full SHA
    07969ad View commit details
  3. Copy the full SHA
    0d70c4f View commit details
  4. make linter happy

    CleanCut committed Jan 12, 2022
    Copy the full SHA
    5949d67 View commit details
  5. use -vvvv in CI and Makefile

    CleanCut committed Jan 12, 2022
    Copy the full SHA
    6d5c9f9 View commit details
  6. Copy the full SHA
    7c0f2e9 View commit details
  7. Copy the full SHA
    e75ce6a View commit details

Commits on Jan 20, 2022

  1. crash on syntax error while loading test files

    - Stop silently ignoring crashes on some loading paths. Notably, when
      you specified a dotname for the target to test and the module had a
      syntax error, then the module was being silently skipped.
    - This changes the behavior when targets are being loaded by filename
      and have a syntax error. Previously we were converting the syntax
      error into a single test failure representing failing to load the
      module. Now the crash occurs before we get that far.
    CleanCut committed Jan 20, 2022
    Copy the full SHA
    ff6372f View commit details
  2. Copy the full SHA
    b4caaa1 View commit details
  3. bump to 3.4.1

    CleanCut committed Jan 20, 2022
    Copy the full SHA
    5c10a4b View commit details

Commits on May 23, 2022

  1. Copy the full SHA
    62744b9 View commit details
  2. Copy the full SHA
    084481d View commit details
  3. fix bitrot in test_versions

    CleanCut committed May 23, 2022
    Copy the full SHA
    a707c6c View commit details
  4. update cli output

    CleanCut committed May 23, 2022
    Copy the full SHA
    82342fa View commit details
  5. update twine install

    CleanCut committed May 23, 2022
    Copy the full SHA
    ff84cf8 View commit details

Commits on Jun 14, 2022

  1. Fix UserWarning in setup.cfg

    coreone committed Jun 14, 2022
    Copy the full SHA
    c9bdae7 View commit details

Commits on Jun 17, 2022

  1. Merge pull request #260 from broadinstitute/setup

    Fix UserWarning in setup.cfg
    CleanCut authored Jun 17, 2022
    Copy the full SHA
    ddfec93 View commit details

Commits on Jul 23, 2022

  1. docs: Fix a few typos

    There are small typos in:
    - green/loader.py
    - green/output.py
    - green/result.py
    
    Fixes:
    - Should read `overridden` rather than `overriden`.
    - Should read `hierarchies` rather than `heirarchies`.
    - Should read `expected` rather than `expeced`.
    - Should read `additional` rather than `additonal`.
    
    Signed-off-by: Tim Gates <tim.gates@iress.com>
    timgates42 committed Jul 23, 2022
    Copy the full SHA
    ad2c8ac View commit details

Commits on Jul 26, 2022

  1. Merge pull request #261 from timgates42/bugfix_typos

    docs: Fix a few typos
    CleanCut authored Jul 26, 2022
    Copy the full SHA
    4939bf8 View commit details

Commits on Sep 20, 2022

  1. Copy the full SHA
    29097cf View commit details
  2. Copy the full SHA
    6bf8508 View commit details
  3. update ci

    CleanCut committed Sep 20, 2022
    Copy the full SHA
    b2667a9 View commit details
  4. Copy the full SHA
    9091bf0 View commit details
  5. bump to 3.4.3

    CleanCut committed Sep 20, 2022
    Copy the full SHA
    ad63342 View commit details
  6. update cli-options

    CleanCut committed Sep 20, 2022
    Copy the full SHA
    9483a2e View commit details

Commits on Apr 25, 2023

  1. Drop code that explicitly supported python 2.

    Tested with `green green` with python 3.6 (some of the test code uses f-strings so we cannot test with python 3.5).
    sodul committed Apr 25, 2023
    Copy the full SHA
    5b3b4fb View commit details

Commits on Apr 26, 2023

  1. Copy the full SHA
    20b74fb View commit details
  2. Copy the full SHA
    98a754a View commit details
  3. Update CHANGELOG.md

    Co-authored-by: Nathan Stocks <cleancut@github.com>
    sodul and CleanCut authored Apr 26, 2023
    Copy the full SHA
    d855d66 View commit details
  4. Update README.md

    Co-authored-by: Nathan Stocks <cleancut@github.com>
    sodul and CleanCut authored Apr 26, 2023
    Copy the full SHA
    3579a1b View commit details
  5. re-run black-23.3.0 from a vanilla container:

    ```
    docker run -it --entrypoint=/bin/bash -v $(pwd):/green python:3.11
    root@bdf5d7007526:/# cd green/
    root@bdf5d7007526:/green# pip install black
    root@bdf5d7007526:/green# black green
    root@bdf5d7007526:/green# black example
    ```
    sodul committed Apr 26, 2023
    Copy the full SHA
    5835e00 View commit details

Commits on May 4, 2023

  1. Merge pull request #269 from clumio-oss/drop_python_v2

    Drop code that explicitly supported python 2.
    CleanCut authored May 4, 2023
    Copy the full SHA
    213854c View commit details
  2. fix some coverage bitrot

    CleanCut committed May 4, 2023
    Copy the full SHA
    f021ba4 View commit details

Commits on May 5, 2023

  1. Add pyproject.toml and move setup.py logic to setup.cfg.

    This will bring forward compatibility with newer versions of pip.
    Drop support for Python 3.5 and older.
    Removed versioned entrypoints, this is not longer relevant now that Python 2 is long deprecated.
    
    Fixes #267
    sodul committed May 5, 2023
    Copy the full SHA
    d93775b View commit details

Commits on May 6, 2023

  1. Copy the full SHA
    ea21e3a View commit details
  2. Copy the full SHA
    8757652 View commit details
  3. Add python 3.6 and 3.7 to the CI checks.

    Run black.
    sodul committed May 6, 2023
    Copy the full SHA
    7a834bc View commit details
  4. Copy the full SHA
    802cd19 View commit details

Commits on May 8, 2023

  1. Merge pull request #268 from clumio-oss/pyproject.toml

    Add pyproject.toml and move setup.py logic to setup.cfg.
    CleanCut authored May 8, 2023
    Copy the full SHA
    2cd780e View commit details

Commits on May 9, 2023

  1. Add mypy to the linting step.

    Address mypy issues.
    Add CONTRIBUTING.md file.
    sodul committed May 9, 2023
    Copy the full SHA
    a5ea452 View commit details
  2. Add ability to run CI checks manually.

    Add 15m timeout to CI checks.
    Update CI checks to pip install green in developer mode.
    sodul committed May 9, 2023
    Copy the full SHA
    423bde7 View commit details

Commits on May 10, 2023

  1. Apply suggestions from code review.

    Co-authored-by: Nathan Stocks <cleancut@github.com>
    sodul and CleanCut committed May 10, 2023
    Copy the full SHA
    047aa15 View commit details

Commits on May 18, 2023

  1. Merge pull request #271 from clumio-oss/mypy

    Add mypy to the linting step.
    CleanCut authored May 18, 2023
    Copy the full SHA
    ff8d950 View commit details

Commits on Dec 3, 2023

  1. update CI python versions

    CleanCut committed Dec 3, 2023
    Copy the full SHA
    6dae383 View commit details
  2. don't try to find Python 2's readfp method

    CleanCut committed Dec 3, 2023
    Copy the full SHA
    d6f160a View commit details

Commits on Dec 4, 2023

  1. Address 'addDuration' warnings in python 3.12.

    This is new to python 3.12 and throws warning on every single test. This adds the new method and related property. Longer term we should probably inherit from the official TestResult class as to ensure better forward compatibility.
    
    This depends on #274.
    sodul committed Dec 4, 2023
    Copy the full SHA
    87c28a7 View commit details
  2. Merge pull request #274 from CleanCut/python3.12

    Fix for Python 3.12
    CleanCut authored Dec 4, 2023
    Copy the full SHA
    06d53db View commit details

Commits on Dec 5, 2023

  1. Merge branch 'main' of https://github.com/CleanCut/green into py3.12-…

    …warnings
    
    * 'main' of https://github.com/CleanCut/green:
      don't try to find Python 2's readfp method
      update CI python versions
    sodul committed Dec 5, 2023
    Copy the full SHA
    b17fbd3 View commit details
  2. Merge pull request #275 from clumio-oss/py3.12-warnings

    Address 'addDuration' warnings in python 3.12.
    CleanCut authored Dec 5, 2023
    Copy the full SHA
    77fe786 View commit details
  3. Copy the full SHA
    072aa43 View commit details
Showing with 2,294 additions and 1,849 deletions.
  1. +25 −17 .github/workflows/ci.yml
  2. +0 −16 .github/workflows/label-sponsors.yml
  3. +37 −0 .github/workflows/release-test.yml
  4. +37 −0 .github/workflows/release.yml
  5. +5 −2 .gitignore
  6. +97 −2 CHANGELOG.md
  7. +110 −0 CONTRIBUTING.md
  8. +42 −17 Makefile
  9. +7 −2 README-pypi.rst
  10. +16 −12 README.md
  11. +1 −1 cli-options.txt
  12. +2 −2 example/proj/foo.py
  13. +4 −3 example/proj/test/test_foo.py
  14. +4 −4 g
  15. +1 −1 green/VERSION
  16. +0 −1 green/__init__.py
  17. +0 −2 green/__main__.py
  18. +24 −13 green/cmdline.py
  19. +43 −21 green/command.py
  20. +151 −151 green/config.py
  21. +38 −31 green/djangorunner.py
  22. +12 −10 green/examples.py
  23. +1 −1 green/exceptions.py
  24. +90 −45 green/junit.py
  25. +147 −96 green/loader.py
  26. +59 −57 green/output.py
  27. +154 −201 green/process.py
  28. +294 −259 green/result.py
  29. +39 −17 green/runner.py
  30. +73 −100 green/suite.py
  31. +1 −6 green/test/test_cmdline.py
  32. +4 −47 green/test/test_command.py
  33. +303 −220 green/test/test_config.py
  34. +1 −6 green/test/test_djangorunner.py
  35. +18 −20 green/test/test_integration.py
  36. +6 −6 green/test/test_junit.py
  37. +1 −8 green/test/test_load_tests.py
  38. +63 −31 green/test/test_loader.py
  39. +2 −13 green/test/test_output.py
  40. +8 −15 green/test/test_process.py
  41. +42 −27 green/test/test_result.py
  42. +157 −204 green/test/test_runner.py
  43. +11 −18 green/test/test_suite.py
  44. +1 −3 green/test/test_version.py
  45. +11 −16 green/version.py
  46. +37 −0 pyproject.toml
  47. +4 −26 release.md
  48. +6 −0 requirements-dev.txt
  49. +0 −3 requirements-optional.txt
  50. +2 −3 requirements.txt
  51. +88 −1 setup.cfg
  52. +7 −80 setup.py
  53. +8 −12 test_versions
42 changes: 25 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -2,50 +2,58 @@ name: CI

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]
workflow_dispatch:

jobs:
tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
python-version: [
"3.8", "3.9", "3.10", "3.11", "3.12.2",
"pypy3.8", "pypy3.9", "pypy3.10"
]
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
- name: Install
run: |
python -m pip install --upgrade pip
pip install --upgrade -r requirements-optional.txt
pip install --upgrade -e '.[dev]'
- name: Lint with black
run: |
pip install --upgrade black
black --check --diff green
if: matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'
- name: Format
run: black --check --diff green example
if: matrix.python-version == '3.12.2' && matrix.os == 'ubuntu-latest'

- name: Mypy
run: mypy green example
if: matrix.python-version == '3.12.2' && matrix.os == 'ubuntu-latest'

- name: Test
run: python -m green.cmdline -tvvv green
if: matrix.python-version != '3.9' || matrix.os != 'ubuntu-latest'
run: |
green -tvvvv green
cd example && green -tvvvv proj
- name: Generate coverage
run: |
pip install --upgrade coveralls
./g -tvvvr green
if: matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'
green -tvvvvr green
if: matrix.python-version == '3.12.2' && matrix.os == 'ubuntu-latest'

- name: Coveralls
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'
if: matrix.python-version == '3.12.2' && matrix.os == 'ubuntu-latest'
16 changes: 0 additions & 16 deletions .github/workflows/label-sponsors.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Keep the content of this file in sync with release.yml.

name: Release Test
on:
workflow_dispatch:

jobs:
pypi-publish:
name: Upload release to PyPI Test
runs-on: ubuntu-latest
environment:
name: release-test
url: https://test.pypi.org/p/green
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: 3.12.2

- name: Install
run: |
python -m pip install --upgrade pip
pip install --upgrade '.[dev]'
- name: Test
run: green -rv green

- name: Build
run: make sdist

- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Keep the content of this file in sync with release-test.yml.

name: Release
on:
release:
types: [published]

jobs:
pypi-publish:
name: Upload release to PyPI
if: github.event_name == 'release'
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/green
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: 3.12.2

- name: Install
run: |
python -m pip install --upgrade pip
pip install --upgrade '.[dev]'
- name: Test
run: green -rv green

- name: Build
run: make sdist

- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
green-*/

# Installer logs
pip-log.txt
@@ -37,14 +38,16 @@ docs/_build/

# Editor files
tags
.idea

# virtualenvs
# virtual environments
venv*
env*
.python-version

*.sublime-workspace

# Emacs
\#*\#
*~
.\#*
.\#*
99 changes: 97 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,98 @@
# Unreleased
#### Date TBD

* Use forkserver start method for multiprocessing by @eltoder in https://github.com/CleanCut/green/pull/296
* Adjust to breaking changes in `setuptools` 72.0.0

# Version 4.0.2
#### 18 Apr 2024

* Fix regression of test_time being always 0.0 by @eltoder in https://github.com/CleanCut/green/pull/292
* Fix regression of zero coverage in internal CI by @eltoder in https://github.com/CleanCut/green/pull/293

## New Contributors
* @eltoder made their first contribution in https://github.com/CleanCut/green/pull/292

# Version 4.0.1
#### 15 Feb 2024

Note that we are explicitly flagging Python 3.12.1 as incompatible due to a regression
that was fixed in 3.12.2.
If you are on 3.12.1, then `pip` will try to install green 4.0.0, but it will
likely crash if you have skipped tests, so you will either need to upgrade to
python 3.12.2, or newer, or rollback to python 3.12.0.

- Cleaned-up existing code to more modern python 3 style, including
comprehensive type annotation.
- Simplify green's dev testing setup.
- Explicitly flag 3.12.1 as incompatible due to https://github.com/python/cpython/issues/113267.
Tracked in #277.
- Publish new releases to PyPI using GitHub Actions.

# Version 4.0.0
#### 16 Jan 2024

The biggest change in this release is the addition of support for new Python versions up through 3.12, and the dropping of support for Python < 3.8, including Python 2 entirely.

There is a breaking in change in Python 3.12.1 which causes Green to break on skipped tests.
The workaround is to use Python 3.12.0 or to comment out unittests that use `@unittest.skipIf(...)` annotation.
We will release a fix for this in the next version of Green.

- Fix an error and warnings that occur with Python 3.12. Contributed by [`@sodul`](https://github.com/sodul) in [#272], [#274], and [#275]
- Add setup.cfg and pyproject.toml to support the setup.py deprecation in pip 23
- Lift minimum supported Python version from 3.5 to 3.8
- CI Improvements:
- Add 3.12 to the CI Action
- Add button to run CI checks manually
- Add 15 minutes timeout to CI checks
- Update CI to pip install green in developer mode
- Add `mypy` linting & fix lint warnings
- Use `pyupgrade` to modernize code
- Use `black` to autoformat code
- Add `pyproject.toml`
- Move `setup.py` logic into `setup.cfg`
- README cleanup
- Fixes for newer versions of coverage
- New maintainer: @sodul.


[#272]: https://github.com/CleanCut/green/issues/272
[#274]: https://github.com/CleanCut/green/pull/274
[#275]: https://github.com/CleanCut/green/pull/275

# Version 3.5.0
#### 12 Jan 2024

This is the final version to support Python 3.6 and 3.7.

- Drop Python 2 support.
- Add Python 3.11 to the CI Action.
- Add setup.cfg and pyproject.toml to support the setup.py deprecation in pip 23.
- Minimum Python version supported is now 3.6.

# Version 3.4.3
#### 20 Sep 2022

This is the final version to support Python 2.

- If green creates a temp directory for tests, but is unable to clean it up, emit a warning instead of crashing. Some tests don't behave well in the temp directory. Resolves #264.

# Version 3.4.2
#### 23 May 2022

- Added `*/dist-packages*` to the default
- The development script, `./g`, now defaults to looking for `python3`

# Version 3.4.1
#### 20 January 2021

- Fixed a situation where syntax errors in a test file were being silently ignored, resulting in the entire test file being omitted from the test. This would happen if the module with a syntax error was loaded via specifying a "dot name" such as `mymodule.MyClass.mytest` as the target to test. Now green reliably crashes in this situation. Note that this changes the behavior for syntax errors when initiated with a filename target. Previously specifying the test target as a filename such as `mymodule.py` that had a syntax error in it would result in converting the loading exception into a single test failure representing the inability to load a test file. Now, we simply crash on the syntax error. In practice, I believe this is an improvement...as syntax errors are easy to fix, and folks are used to hitting the crash and fixing them, while obscuring them behind a custom test failure is not only unusual, it's also a lot of work to make it happen inside green.

# Version 3.4.0
#### 12 January 2021

- Four levels of verbosity (`-vvvv` on the command line or `verbose=4` in the config) now displays the test method name _and_ the test method docstring. Resolves #252.

# Version 3.3.0
#### 15 July 2021

@@ -73,7 +168,7 @@

- Fixed a hang that sometimes occurs in Python 3.8.0-3.8.2 due to a bug in upstream Python
- Upstream bug report: https://bugs.python.org/issue39360
- Upstream fix in master: https://github.com/python/cpython/pull/19009
- Upstream fix in main: https://github.com/python/cpython/pull/19009
- Upstream fix in 3.8 branch (Maybe gets included in 3.8.3?): https://github.com/python/cpython/pull/19023
- Fixed behavior of raising SkipTest in a setUpClass class method on Python >= 3.8

@@ -294,7 +389,7 @@
#### 26 April 2017

- Added a page about the Udemy course
[Python Testing with Green](https://github.com/CleanCut/green/blob/master/PythonTestingWithGreen.md),
[Python Testing with Green](https://github.com/CleanCut/green/blob/main/PythonTestingWithGreen.md),
with lots of nice coupons and discount codes just for finding the Github
page. Check it out!

Loading