Skip to content

Commit a152006

Browse files
committed
Failing pytest reproducing #1150
pytest -sv tests/test_declare.py::test_table_name_with_underscores
1 parent 6dd57cc commit a152006

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/test_declare.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,3 +337,25 @@ class WithSuchALongPartNameThatItCrashesMySQL(dj.Part):
337337

338338
with pytest.raises(dj.DataJointError):
339339
schema_any(WhyWouldAnyoneCreateATableNameThisLong)
340+
341+
342+
def test_table_name_with_underscores(schema_any):
343+
"""
344+
Test issue #1150 -- Reject table names containing underscores. Tables should be in strict
345+
CamelCase.
346+
"""
347+
348+
class TableNoUnderscores(dj.Manual):
349+
definition = """
350+
id : int
351+
"""
352+
353+
class Table_With_Underscores(dj.Manual):
354+
definition = """
355+
id : int
356+
"""
357+
358+
schema_any(TableNoUnderscores)
359+
with pytest.raises(dj.DataJointError, match="CamelCase") as e:
360+
schema_any(Table_With_Underscores)
361+

0 commit comments

Comments
 (0)