Replace std::env::temp_dir with tempdir in tests (#8103)
* std::env::temp_dir -> tempdir in test context * fix lifetime issue so tempdir removes tmpfiles
This commit is contained in:
committed by
Marek Kotewicz
parent
7e948a088f
commit
23fc5517b5
@@ -832,11 +832,13 @@ mod tests {
|
||||
use state::State;
|
||||
use tests::helpers::get_temp_state_db;
|
||||
use views::BlockView;
|
||||
use tempdir::TempDir;
|
||||
|
||||
// https://github.com/paritytech/parity/issues/1840
|
||||
#[test]
|
||||
fn test_load_empty() {
|
||||
assert!(Spec::load(&::std::env::temp_dir(), &[] as &[u8]).is_err());
|
||||
let tempdir = TempDir::new("").unwrap();
|
||||
assert!(Spec::load(&tempdir.path(), &[] as &[u8]).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user