Skip to content

Commit

Permalink
Auto merge of #6799 - ehuss:fix-member_manifest_version_error-network…
Browse files Browse the repository at this point in the history
…, r=alexcrichton

Fix member_manifest_version_error accessing the network.

This test was updating the registry via github.  Add a `.cargo/config` file so that it doesn't.
  • Loading branch information
bors committed Mar 31, 2019
2 parents 2fc2db1 + f01428b commit ede459e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/testsuite/member_errors.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use cargo::core::resolver::ResolveError;
use cargo::core::{compiler::CompileMode, Workspace};
use cargo::core::{compiler::CompileMode, Shell, Workspace};
use cargo::ops::{self, CompileOptions};
use cargo::util::{config::Config, errors::ManifestError};

use crate::support::install::cargo_home;
use crate::support::project;
use crate::support::registry;

/// Tests inclusion of a `ManifestError` pointing to a member manifest
/// when that manifest fails to deserialize.
Expand Down Expand Up @@ -139,7 +141,9 @@ fn member_manifest_version_error() {
.file("bar/src/main.rs", "fn main() {}")
.build();

let config = Config::default().unwrap();
// Prevent this test from accessing the network by setting up .cargo/config.
registry::init();
let config = Config::new(Shell::new(), cargo_home(), cargo_home());
let ws = Workspace::new(&p.root().join("Cargo.toml"), &config).unwrap();
let compile_options = CompileOptions::new(&config, CompileMode::Build).unwrap();
let member_bar = ws.members().find(|m| &*m.name() == "bar").unwrap();
Expand Down

0 comments on commit ede459e

Please sign in to comment.