mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 14:52:01 +00:00
[red-knot] Unify setup_db()
functions, add TestDb
builder (#14777)
## Summary - Instead of seven (more or less similar) `setup_db` functions, use just one in a single central place. - For every test that needs customization beyond that, offer a `TestDbBuilder` that can control the Python target version, custom typeshed, and pre-existing files. The main motivation for this is that we're soon going to need customization of the Python version, and I didn't feel like adding this to each of the existing `setup_db` functions.
This commit is contained in:
parent
155d34bbb9
commit
bd27bfab5d
9 changed files with 116 additions and 200 deletions
|
@ -90,7 +90,7 @@ impl<'db> Symbol<'db> {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::types::tests::setup_db;
|
||||
use crate::db::tests::setup_db;
|
||||
|
||||
#[test]
|
||||
fn test_symbol_or_fall_back_to() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue