File: test_travis.py

package info (click to toggle)
python-ci-info 0.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 232 kB
  • sloc: python: 1,708; makefile: 3
file content (19 lines) | stat: -rw-r--r-- 466 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""Test should only pass in travis-ci environment"""
import os
import ci_info

def test_travis(tmpdir):
    IS_REAL_PR = bool(
        os.getenv("TRAVIS_PULL_REQUEST") and
        os.getenv("TRAVIS_PULL_REQUEST") != "false"
    )

    assert ci_info.name() == "Travis CI"
    assert ci_info.is_ci() is True
    assert ci_info.is_pr() == IS_REAL_PR

    assert ci_info.info() == {
        "name": "Travis CI",
        "is_ci": True,
        "is_pr": IS_REAL_PR
    }