Skip to content

Commit f7bd8af

Browse files
committed
Add a test for --features nighly on travis
1 parent 361e175 commit f7bd8af

File tree

6 files changed

+12
-15
lines changed

6 files changed

+12
-15
lines changed

.travis.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,25 @@ jobs:
1616
python: "3.7"
1717
- name: Python 3.8
1818
python: "3.8"
19+
# Run clippy and rustfmt
20+
env: RUN_LINT=1
1921
- name: Python 3.9-dev
2022
python: "3.9-dev"
21-
- name: Minimum nightly
23+
- name: Nightly
2224
python: "3.7"
23-
# Keep this synced up with build.rs and ensure that the nightly version does have clippy available
24-
# https://static.rust-lang.org/dist/YYYY-MM-DD/clippy-nightly-x86_64-unknown-linux-gnu.tar.gz exists
25-
env: TRAVIS_RUST_VERSION=nightly-2020-01-21
25+
env: TRAVIS_RUST_VERSION=nightly FEATURES="nightly"
2626
- name: PyPy3.5 7.0 # Tested via anaconda PyPy (since travis's PyPy version is too old)
2727
python: "3.7"
2828
env: FEATURES="pypy" PATH="$PATH:/opt/anaconda/envs/pypy3/bin"
2929
allow_failures:
30+
- name: Nightly
3031
- python: 3.9-dev
3132

3233
env:
3334
global:
3435
- TRAVIS_RUST_VERSION=stable
3536
- RUST_BACKTRACE=1
37+
- RUN_LINT=0
3638

3739
before_install:
3840
- source ./ci/travis/setup.sh

ci/travis/setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e
77
# Use profile=minimal here to skip installing clippy
88
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=$TRAVIS_RUST_VERSION --profile=minimal -y
99
export PATH=$PATH:$HOME/.cargo/bin
10-
if [ "$TRAVIS_JOB_NAME" = "Minimum nightly" ]; then
10+
if [[ $RUN_LINT == 1 ]]; then
1111
rustup component add clippy
1212
rustup component add rustfmt
1313
fi

ci/travis/test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ else
1010
PYTHON_SYS_EXECUTABLE="/opt/anaconda/envs/pypy3/bin/pypy3" cargo build;
1111
fi
1212

13-
if [ "$TRAVIS_JOB_NAME" = "Minimum nightly" ]; then
13+
if [[ $RUN_LINT == 1 ]]; then
1414
pip install --pre black==19.3b0
1515
make lint
1616
fi

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(nightly, feature(specialization))]
1+
#![cfg_attr(feature = "nightly", feature(specialization))]
22
#![allow(clippy::missing_safety_doc)] // FIXME (#698)
33

44
//! Rust bindings to the Python interpreter.

tests/test_compile_error.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ fn test_compile_errors() {
77
t.compile_fail("tests/ui/missing_clone.rs");
88
t.compile_fail("tests/ui/reject_generics.rs");
99
t.compile_fail("tests/ui/wrong_aspyref_lifetimes.rs");
10-
// Since the current minimum nightly(2020-01-20) has a different error message,
11-
// we skip this test.
12-
// TODO(kngwyu): Remove this `if` when we update minimum nightly.
13-
if option_env!("TRAVIS_JOB_NAME") != Some("Minimum nightly") {
14-
t.compile_fail("tests/ui/invalid_pymethod_names.rs");
15-
t.compile_fail("tests/ui/static_ref.rs");
16-
}
10+
t.compile_fail("tests/ui/static_ref.rs");
11+
#[cfg(not(feature = "nightly"))]
12+
t.compile_fail("tests/ui/invalid_pymethod_names.rs");
1713
}

tests/test_datetime.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use pyo3::ffi::*;
21
use pyo3::prelude::*;
32
use pyo3::types::IntoPyDict;
43

0 commit comments

Comments
 (0)