summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/config/README.md1
-rw-r--r--src/modules/python.rs2
-rw-r--r--tests/testsuite/python.rs17
3 files changed, 20 insertions, 0 deletions
diff --git a/docs/config/README.md b/docs/config/README.md
index 0928779c2..08ee6d442 100644
--- a/docs/config/README.md
+++ b/docs/config/README.md
@@ -568,6 +568,7 @@ The module will be shown if any of the following conditions are met:
- The current directory contains a `pyproject.toml` file
- The current directory contains a file with the `.py` extension
- The current directory contains a `Pipfile` file
+- The current directory contains a `tox.ini` file
### Options
diff --git a/src/modules/python.rs b/src/modules/python.rs
index 84ca0e7e8..b871ef808 100644
--- a/src/modules/python.rs
+++ b/src/modules/python.rs
@@ -14,6 +14,7 @@ use super::{Context, Module};
/// - Current directory contains a `pyproject.toml` file
/// - Current directory contains a file with the `.py` extension
/// - Current directory contains a `Pipfile` file
+/// - Current directory contains a `tox.ini` file
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
let is_py_project = context
.try_begin_scan()?
@@ -22,6 +23,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
".python-version",
"pyproject.toml",
"Pipfile",
+ "tox.ini",
])
.set_extensions(&["py"])
.is_match();
diff --git a/tests/testsuite/python.rs b/tests/testsuite/python.rs
index e978baba9..eba959ce5 100644
--- a/tests/testsuite/python.rs
+++ b/tests/testsuite/python.rs
@@ -75,6 +75,23 @@ fn folder_with_pipfile() -> io::Result<()> {
#[test]
#[ignore]
+fn folder_with_tox() -> io::Result<()> {
+ let dir = common::new_tempdir()?;
+ File::create(dir.path().join("tox.ini"))?;
+
+ let output = common::render_module("python")
+ .arg("--path")
+ .arg(dir.path())
+ .output()?;
+ let actual = String::from_utf8(output.stdout).unwrap();
+
+ let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.6.9"));
+ assert_eq!(expected, actual);
+ Ok(())
+}
+
+#[test]
+#[ignore]
fn folder_with_py_file() -> io::Result<()> {
let dir = common::new_tempdir()?;
File::create(dir.path().join("main.py"))?;