Search is not available for this dataset
identifier stringlengths 1 155 | parameters stringlengths 2 6.09k | docstring stringlengths 11 63.4k | docstring_summary stringlengths 0 63.4k | function stringlengths 29 99.8k | function_tokens list | start_point list | end_point list | language stringclasses 1
value | docstring_language stringlengths 2 7 | docstring_language_predictions stringlengths 18 23 | is_langid_reliable stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
ManageFullPathDefaultSettings.test_builtin_command | (self) | fulldefault: manage.py builtin commands succeed when default settings are appropriate | fulldefault: manage.py builtin commands succeed when default settings are appropriate | def test_builtin_command(self):
"fulldefault: manage.py builtin commands succeed when default settings are appropriate"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, 'CREATE TABLE') | [
"def",
"test_builtin_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
")",
"self",
".",
"assertOutp... | [
759,
4
] | [
764,
46
] | python | en | ['en', 'en', 'en'] | True |
ManageFullPathDefaultSettings.test_builtin_with_settings | (self) | fulldefault: manage.py builtin commands succeed if settings are provided as argument | fulldefault: manage.py builtin commands succeed if settings are provided as argument | def test_builtin_with_settings(self):
"fulldefault: manage.py builtin commands succeed if settings are provided as argument"
args = ['sqlall', '--settings=test_project.settings', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, 'CR... | [
"def",
"test_builtin_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=test_project.settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
... | [
766,
4
] | [
771,
46
] | python | en | ['en', 'en', 'en'] | True |
ManageFullPathDefaultSettings.test_builtin_with_environment | (self) | fulldefault: manage.py builtin commands succeed if settings are provided in the environment | fulldefault: manage.py builtin commands succeed if settings are provided in the environment | def test_builtin_with_environment(self):
"fulldefault: manage.py builtin commands succeed if settings are provided in the environment"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args, 'test_project.settings')
self.assertNoOutput(err)
self.assertOutput(out, 'CRE... | [
"def",
"test_builtin_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'test_project.settings'",
")",
"self",
".",
"assertNoOutput",
"(",
... | [
773,
4
] | [
778,
46
] | python | en | ['en', 'en', 'en'] | True |
ManageFullPathDefaultSettings.test_builtin_with_bad_settings | (self) | fulldefault: manage.py builtin commands succeed if settings file (from argument) doesn't exist | fulldefault: manage.py builtin commands succeed if settings file (from argument) doesn't exist | def test_builtin_with_bad_settings(self):
"fulldefault: manage.py builtin commands succeed if settings file (from argument) doesn't exist"
args = ['sqlall', '--settings=bad_settings', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err... | [
"def",
"test_builtin_with_bad_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=bad_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"("... | [
780,
4
] | [
785,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageFullPathDefaultSettings.test_builtin_with_bad_environment | (self) | fulldefault: manage.py builtin commands fail if settings file (from environment) doesn't exist | fulldefault: manage.py builtin commands fail if settings file (from environment) doesn't exist | def test_builtin_with_bad_environment(self):
"fulldefault: manage.py builtin commands fail if settings file (from environment) doesn't exist"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args, 'bad_settings')
self.assertNoOutput(out)
self.assertOutput(err, "No mo... | [
"def",
"test_builtin_with_bad_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'bad_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"out... | [
787,
4
] | [
792,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageFullPathDefaultSettings.test_custom_command | (self) | fulldefault: manage.py can execute user commands when default settings are appropriate | fulldefault: manage.py can execute user commands when default settings are appropriate | def test_custom_command(self):
"fulldefault: manage.py can execute user commands when default settings are appropriate"
args = ['noargs_command']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, "EXECUTE: noargs_command") | [
"def",
"test_custom_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
")",
"self",
".",
"assertOutput",
"(",
"out",
... | [
794,
4
] | [
799,
57
] | python | en | ['en', 'en', 'en'] | True |
ManageFullPathDefaultSettings.test_custom_command_with_settings | (self) | fulldefault: manage.py can execute user commands when settings are provided as argument | fulldefault: manage.py can execute user commands when settings are provided as argument | def test_custom_command_with_settings(self):
"fulldefault: manage.py can execute user commands when settings are provided as argument"
args = ['noargs_command', '--settings=test_project.settings']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, "E... | [
"def",
"test_custom_command_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
",",
"'--settings=test_project.settings'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"err... | [
801,
4
] | [
806,
57
] | python | en | ['en', 'en', 'en'] | True |
ManageFullPathDefaultSettings.test_custom_command_with_environment | (self) | fulldefault: manage.py can execute user commands when settings are provided in environment | fulldefault: manage.py can execute user commands when settings are provided in environment | def test_custom_command_with_environment(self):
"fulldefault: manage.py can execute user commands when settings are provided in environment"
args = ['noargs_command']
out, err = self.run_manage(args, 'test_project.settings')
self.assertNoOutput(err)
self.assertOutput(out, "EXECUT... | [
"def",
"test_custom_command_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'test_project.settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
")"... | [
808,
4
] | [
813,
57
] | python | en | ['en', 'en', 'en'] | True |
ManageMinimalSettings.test_builtin_command | (self) | minimal: manage.py builtin commands fail with an error when no settings provided | minimal: manage.py builtin commands fail with an error when no settings provided | def test_builtin_command(self):
"minimal: manage.py builtin commands fail with an error when no settings provided"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "No installed app with label 'admin_scripts'.") | [
"def",
"test_builtin_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"assertOutp... | [
826,
4
] | [
831,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageMinimalSettings.test_builtin_with_settings | (self) | minimal: manage.py builtin commands fail if settings are provided as argument | minimal: manage.py builtin commands fail if settings are provided as argument | def test_builtin_with_settings(self):
"minimal: manage.py builtin commands fail if settings are provided as argument"
args = ['sqlall', '--settings=test_project.settings', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "No instal... | [
"def",
"test_builtin_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=test_project.settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
... | [
833,
4
] | [
838,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageMinimalSettings.test_builtin_with_environment | (self) | minimal: manage.py builtin commands fail if settings are provided in the environment | minimal: manage.py builtin commands fail if settings are provided in the environment | def test_builtin_with_environment(self):
"minimal: manage.py builtin commands fail if settings are provided in the environment"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args, 'test_project.settings')
self.assertNoOutput(out)
self.assertOutput(err, "No install... | [
"def",
"test_builtin_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'test_project.settings'",
")",
"self",
".",
"assertNoOutput",
"(",
... | [
840,
4
] | [
845,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageMinimalSettings.test_builtin_with_bad_settings | (self) | minimal: manage.py builtin commands fail if settings file (from argument) doesn't exist | minimal: manage.py builtin commands fail if settings file (from argument) doesn't exist | def test_builtin_with_bad_settings(self):
"minimal: manage.py builtin commands fail if settings file (from argument) doesn't exist"
args = ['sqlall', '--settings=bad_settings', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "No m... | [
"def",
"test_builtin_with_bad_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=bad_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"("... | [
847,
4
] | [
852,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageMinimalSettings.test_builtin_with_bad_environment | (self) | minimal: manage.py builtin commands fail if settings file (from environment) doesn't exist | minimal: manage.py builtin commands fail if settings file (from environment) doesn't exist | def test_builtin_with_bad_environment(self):
"minimal: manage.py builtin commands fail if settings file (from environment) doesn't exist"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args, 'bad_settings')
self.assertNoOutput(out)
self.assertOutput(err, "No module... | [
"def",
"test_builtin_with_bad_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'bad_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"out... | [
854,
4
] | [
859,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageMinimalSettings.test_custom_command | (self) | minimal: manage.py can't execute user commands without appropriate settings | minimal: manage.py can't execute user commands without appropriate settings | def test_custom_command(self):
"minimal: manage.py can't execute user commands without appropriate settings"
args = ['noargs_command']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "Unknown command: 'noargs_command'") | [
"def",
"test_custom_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"assertOutput",
"(",
"err",
... | [
861,
4
] | [
866,
67
] | python | en | ['en', 'en', 'en'] | True |
ManageMinimalSettings.test_custom_command_with_settings | (self) | minimal: manage.py can't execute user commands, even if settings are provided as argument | minimal: manage.py can't execute user commands, even if settings are provided as argument | def test_custom_command_with_settings(self):
"minimal: manage.py can't execute user commands, even if settings are provided as argument"
args = ['noargs_command', '--settings=test_project.settings']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, ... | [
"def",
"test_custom_command_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
",",
"'--settings=test_project.settings'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out... | [
868,
4
] | [
873,
67
] | python | en | ['en', 'en', 'en'] | True |
ManageMinimalSettings.test_custom_command_with_environment | (self) | minimal: manage.py can't execute user commands, even if settings are provided in environment | minimal: manage.py can't execute user commands, even if settings are provided in environment | def test_custom_command_with_environment(self):
"minimal: manage.py can't execute user commands, even if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_manage(args, 'test_project.settings')
self.assertNoOutput(out)
self.assertOutput(err, "Unkn... | [
"def",
"test_custom_command_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'test_project.settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")"... | [
875,
4
] | [
880,
67
] | python | en | ['en', 'en', 'en'] | True |
ManageAlternateSettings.test_builtin_command | (self) | alternate: manage.py builtin commands fail with an error when no default settings provided | alternate: manage.py builtin commands fail with an error when no default settings provided | def test_builtin_command(self):
"alternate: manage.py builtin commands fail with an error when no default settings provided"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "No module named '?(test_project\.)?set... | [
"def",
"test_builtin_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"assertOutp... | [
893,
4
] | [
898,
91
] | python | en | ['en', 'en', 'en'] | True |
ManageAlternateSettings.test_builtin_with_settings | (self) | alternate: manage.py builtin commands work with settings provided as argument | alternate: manage.py builtin commands work with settings provided as argument | def test_builtin_with_settings(self):
"alternate: manage.py builtin commands work with settings provided as argument"
args = ['sqlall', '--settings=alternate_settings', 'admin_scripts']
out, err = self.run_manage(args)
expected = ('create table %s'
% connection.ops.qu... | [
"def",
"test_builtin_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=alternate_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"expected",
"=",
"(",
"'create t... | [
900,
4
] | [
907,
32
] | python | en | ['en', 'en', 'en'] | True |
ManageAlternateSettings.test_builtin_with_environment | (self) | alternate: manage.py builtin commands work if settings are provided in the environment | alternate: manage.py builtin commands work if settings are provided in the environment | def test_builtin_with_environment(self):
"alternate: manage.py builtin commands work if settings are provided in the environment"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args, 'alternate_settings')
expected = ('create table %s'
% connection.ops.q... | [
"def",
"test_builtin_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'alternate_settings'",
")",
"expected",
"=",
"(",
"'create table %s'... | [
909,
4
] | [
916,
32
] | python | en | ['en', 'en', 'en'] | True |
ManageAlternateSettings.test_builtin_with_bad_settings | (self) | alternate: manage.py builtin commands fail if settings file (from argument) doesn't exist | alternate: manage.py builtin commands fail if settings file (from argument) doesn't exist | def test_builtin_with_bad_settings(self):
"alternate: manage.py builtin commands fail if settings file (from argument) doesn't exist"
args = ['sqlall', '--settings=bad_settings', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "No... | [
"def",
"test_builtin_with_bad_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=bad_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"("... | [
918,
4
] | [
923,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageAlternateSettings.test_builtin_with_bad_environment | (self) | alternate: manage.py builtin commands fail if settings file (from environment) doesn't exist | alternate: manage.py builtin commands fail if settings file (from environment) doesn't exist | def test_builtin_with_bad_environment(self):
"alternate: manage.py builtin commands fail if settings file (from environment) doesn't exist"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args, 'bad_settings')
self.assertNoOutput(out)
self.assertOutput(err, "No modu... | [
"def",
"test_builtin_with_bad_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'bad_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"out... | [
925,
4
] | [
930,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageAlternateSettings.test_custom_command | (self) | alternate: manage.py can't execute user commands without settings | alternate: manage.py can't execute user commands without settings | def test_custom_command(self):
"alternate: manage.py can't execute user commands without settings"
args = ['noargs_command']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "No module named '?(test_project\.)?settings'?", regex=True) | [
"def",
"test_custom_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"assertOutput",
"(",
"err",
... | [
932,
4
] | [
937,
91
] | python | en | ['en', 'en', 'en'] | True |
ManageAlternateSettings.test_custom_command_with_settings | (self) | alternate: manage.py can execute user commands if settings are provided as argument | alternate: manage.py can execute user commands if settings are provided as argument | def test_custom_command_with_settings(self):
"alternate: manage.py can execute user commands if settings are provided as argument"
args = ['noargs_command', '--settings=alternate_settings']
out, err = self.run_manage(args)
self.assertOutput(out, "EXECUTE: noargs_command options=[('no_col... | [
"def",
"test_custom_command_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
",",
"'--settings=alternate_settings'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertOutput",
"(",
"out",
... | [
939,
4
] | [
944,
32
] | python | en | ['en', 'en', 'en'] | True |
ManageAlternateSettings.test_custom_command_with_environment | (self) | alternate: manage.py can execute user commands if settings are provided in environment | alternate: manage.py can execute user commands if settings are provided in environment | def test_custom_command_with_environment(self):
"alternate: manage.py can execute user commands if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_manage(args, 'alternate_settings')
self.assertOutput(out, "EXECUTE: noargs_command options=[('no_color', ... | [
"def",
"test_custom_command_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'alternate_settings'",
")",
"self",
".",
"assertOutput",
"(",
"out",
",",
"... | [
946,
4
] | [
951,
32
] | python | en | ['en', 'en', 'en'] | True |
ManageAlternateSettings.test_custom_command_output_color | (self) | alternate: manage.py output syntax color can be deactivated with the `--no-color` option | alternate: manage.py output syntax color can be deactivated with the `--no-color` option | def test_custom_command_output_color(self):
"alternate: manage.py output syntax color can be deactivated with the `--no-color` option"
args = ['noargs_command', '--no-color', '--settings=alternate_settings']
out, err = self.run_manage(args)
self.assertOutput(out, "EXECUTE: noargs_command... | [
"def",
"test_custom_command_output_color",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
",",
"'--no-color'",
",",
"'--settings=alternate_settings'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertOut... | [
953,
4
] | [
958,
32
] | python | en | ['en', 'en', 'en'] | True |
ManageMultipleSettings.test_builtin_command | (self) | multiple: manage.py builtin commands fail with an error when no settings provided | multiple: manage.py builtin commands fail with an error when no settings provided | def test_builtin_command(self):
"multiple: manage.py builtin commands fail with an error when no settings provided"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "No installed app with label 'admin_scripts'.") | [
"def",
"test_builtin_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"assertOutp... | [
975,
4
] | [
980,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageMultipleSettings.test_builtin_with_settings | (self) | multiple: manage.py builtin commands succeed if settings are provided as argument | multiple: manage.py builtin commands succeed if settings are provided as argument | def test_builtin_with_settings(self):
"multiple: manage.py builtin commands succeed if settings are provided as argument"
args = ['sqlall', '--settings=alternate_settings', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, 'CREATE T... | [
"def",
"test_builtin_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=alternate_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"... | [
982,
4
] | [
987,
46
] | python | en | ['en', 'en', 'en'] | True |
ManageMultipleSettings.test_builtin_with_environment | (self) | multiple: manage.py can execute builtin commands if settings are provided in the environment | multiple: manage.py can execute builtin commands if settings are provided in the environment | def test_builtin_with_environment(self):
"multiple: manage.py can execute builtin commands if settings are provided in the environment"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args, 'alternate_settings')
self.assertNoOutput(err)
self.assertOutput(out, 'CREAT... | [
"def",
"test_builtin_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'alternate_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"e... | [
989,
4
] | [
994,
46
] | python | en | ['en', 'en', 'en'] | True |
ManageMultipleSettings.test_builtin_with_bad_settings | (self) | multiple: manage.py builtin commands fail if settings file (from argument) doesn't exist | multiple: manage.py builtin commands fail if settings file (from argument) doesn't exist | def test_builtin_with_bad_settings(self):
"multiple: manage.py builtin commands fail if settings file (from argument) doesn't exist"
args = ['sqlall', '--settings=bad_settings', 'admin_scripts']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "No ... | [
"def",
"test_builtin_with_bad_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--settings=bad_settings'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"("... | [
996,
4
] | [
1001,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageMultipleSettings.test_builtin_with_bad_environment | (self) | multiple: manage.py builtin commands fail if settings file (from environment) doesn't exist | multiple: manage.py builtin commands fail if settings file (from environment) doesn't exist | def test_builtin_with_bad_environment(self):
"multiple: manage.py builtin commands fail if settings file (from environment) doesn't exist"
args = ['sqlall', 'admin_scripts']
out, err = self.run_manage(args, 'bad_settings')
self.assertNoOutput(out)
self.assertOutput(err, "No modul... | [
"def",
"test_builtin_with_bad_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'bad_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"out... | [
1003,
4
] | [
1008,
78
] | python | en | ['en', 'en', 'en'] | True |
ManageMultipleSettings.test_custom_command | (self) | multiple: manage.py can't execute user commands using default settings | multiple: manage.py can't execute user commands using default settings | def test_custom_command(self):
"multiple: manage.py can't execute user commands using default settings"
args = ['noargs_command']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "Unknown command: 'noargs_command'") | [
"def",
"test_custom_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
".",
"assertOutput",
"(",
"err",
... | [
1010,
4
] | [
1015,
67
] | python | en | ['de', 'en', 'en'] | True |
ManageMultipleSettings.test_custom_command_with_settings | (self) | multiple: manage.py can execute user commands if settings are provided as argument | multiple: manage.py can execute user commands if settings are provided as argument | def test_custom_command_with_settings(self):
"multiple: manage.py can execute user commands if settings are provided as argument"
args = ['noargs_command', '--settings=alternate_settings']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, "EXECUTE: ... | [
"def",
"test_custom_command_with_settings",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
",",
"'--settings=alternate_settings'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
... | [
1017,
4
] | [
1022,
57
] | python | en | ['en', 'en', 'en'] | True |
ManageMultipleSettings.test_custom_command_with_environment | (self) | multiple: manage.py can execute user commands if settings are provided in environment | multiple: manage.py can execute user commands if settings are provided in environment | def test_custom_command_with_environment(self):
"multiple: manage.py can execute user commands if settings are provided in environment"
args = ['noargs_command']
out, err = self.run_manage(args, 'alternate_settings')
self.assertNoOutput(err)
self.assertOutput(out, "EXECUTE: noarg... | [
"def",
"test_custom_command_with_environment",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
",",
"'alternate_settings'",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
")",
... | [
1024,
4
] | [
1029,
57
] | python | en | ['en', 'en', 'en'] | True |
ManageSettingsWithSettingsErrors.test_import_error | (self) |
import error: manage.py builtin commands shows useful diagnostic info
when settings with import errors is provided (#14130).
|
import error: manage.py builtin commands shows useful diagnostic info
when settings with import errors is provided (#14130).
| def test_import_error(self):
"""
import error: manage.py builtin commands shows useful diagnostic info
when settings with import errors is provided (#14130).
"""
self.write_settings_with_import_error('settings.py')
args = ['sqlall', 'admin_scripts']
out, err = sel... | [
"def",
"test_import_error",
"(",
"self",
")",
":",
"self",
".",
"write_settings_with_import_error",
"(",
"'settings.py'",
")",
"args",
"=",
"[",
"'sqlall'",
",",
"'admin_scripts'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"se... | [
1046,
4
] | [
1056,
42
] | python | en | ['en', 'error', 'th'] | False |
ManageSettingsWithSettingsErrors.test_attribute_error | (self) |
manage.py builtin commands does not swallow attribute error due to bad
settings (#18845).
|
manage.py builtin commands does not swallow attribute error due to bad
settings (#18845).
| def test_attribute_error(self):
"""
manage.py builtin commands does not swallow attribute error due to bad
settings (#18845).
"""
self.write_settings('settings.py', sdict={'BAD_VAR': 'INSTALLED_APPS.crash'})
args = ['collectstatic', 'admin_scripts']
out, err = sel... | [
"def",
"test_attribute_error",
"(",
"self",
")",
":",
"self",
".",
"write_settings",
"(",
"'settings.py'",
",",
"sdict",
"=",
"{",
"'BAD_VAR'",
":",
"'INSTALLED_APPS.crash'",
"}",
")",
"args",
"=",
"[",
"'collectstatic'",
",",
"'admin_scripts'",
"]",
"out",
",... | [
1058,
4
] | [
1067,
88
] | python | en | ['en', 'error', 'th'] | False |
ManageSettingsWithSettingsErrors.test_help | (self) |
Test listing available commands output note when only core commands are
available.
|
Test listing available commands output note when only core commands are
available.
| def test_help(self):
"""
Test listing available commands output note when only core commands are
available.
"""
self.write_settings('settings.py', sdict={'MEDIA_URL': '"/no_ending_slash"'})
args = ['help']
out, err = self.run_manage(args)
self.assertOutput... | [
"def",
"test_help",
"(",
"self",
")",
":",
"self",
".",
"write_settings",
"(",
"'settings.py'",
",",
"sdict",
"=",
"{",
"'MEDIA_URL'",
":",
"'\"/no_ending_slash\"'",
"}",
")",
"args",
"=",
"[",
"'help'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_man... | [
1076,
4
] | [
1085,
32
] | python | en | ['en', 'error', 'th'] | False |
ManageCheck.test_nonexistent_app | (self) | manage.py check reports an error on a non-existent app in
INSTALLED_APPS | manage.py check reports an error on a non-existent app in
INSTALLED_APPS | def test_nonexistent_app(self):
""" manage.py check reports an error on a non-existent app in
INSTALLED_APPS """
self.write_settings('settings.py',
apps=['admin_scriptz.broken_app'],
sdict={'USE_I18N': False})
args = ['check']
out, err = self.run_manage(a... | [
"def",
"test_nonexistent_app",
"(",
"self",
")",
":",
"self",
".",
"write_settings",
"(",
"'settings.py'",
",",
"apps",
"=",
"[",
"'admin_scriptz.broken_app'",
"]",
",",
"sdict",
"=",
"{",
"'USE_I18N'",
":",
"False",
"}",
")",
"args",
"=",
"[",
"'check'",
... | [
1092,
4
] | [
1104,
47
] | python | en | ['en', 'en', 'en'] | True |
ManageCheck.test_broken_app | (self) | manage.py check reports an ImportError if an app's models.py
raises one on import | manage.py check reports an ImportError if an app's models.py
raises one on import | def test_broken_app(self):
""" manage.py check reports an ImportError if an app's models.py
raises one on import """
self.write_settings('settings.py', apps=['admin_scripts.broken_app'])
args = ['check']
out, err = self.run_manage(args)
self.assertNoOutput(out)
s... | [
"def",
"test_broken_app",
"(",
"self",
")",
":",
"self",
".",
"write_settings",
"(",
"'settings.py'",
",",
"apps",
"=",
"[",
"'admin_scripts.broken_app'",
"]",
")",
"args",
"=",
"[",
"'check'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
... | [
1106,
4
] | [
1114,
45
] | python | en | ['en', 'en', 'en'] | True |
ManageCheck.test_complex_app | (self) | manage.py check does not raise an ImportError validating a
complex app with nested calls to load_app | manage.py check does not raise an ImportError validating a
complex app with nested calls to load_app | def test_complex_app(self):
""" manage.py check does not raise an ImportError validating a
complex app with nested calls to load_app """
self.write_settings(
'settings.py',
apps=[
'admin_scripts.complex_app',
'admin_scripts.simple_app',
... | [
"def",
"test_complex_app",
"(",
"self",
")",
":",
"self",
".",
"write_settings",
"(",
"'settings.py'",
",",
"apps",
"=",
"[",
"'admin_scripts.complex_app'",
",",
"'admin_scripts.simple_app'",
",",
"'django.contrib.admin.apps.SimpleAdminConfig'",
",",
"'django.contrib.auth'"... | [
1116,
4
] | [
1136,
82
] | python | en | ['en', 'en', 'en'] | True |
ManageCheck.test_app_with_import | (self) | manage.py check does not raise errors when an app imports a base
class that itself has an abstract base. | manage.py check does not raise errors when an app imports a base
class that itself has an abstract base. | def test_app_with_import(self):
""" manage.py check does not raise errors when an app imports a base
class that itself has an abstract base. """
self.write_settings('settings.py',
apps=['admin_scripts.app_with_import',
'django.contrib.auth',
'djan... | [
"def",
"test_app_with_import",
"(",
"self",
")",
":",
"self",
".",
"write_settings",
"(",
"'settings.py'",
",",
"apps",
"=",
"[",
"'admin_scripts.app_with_import'",
",",
"'django.contrib.auth'",
",",
"'django.contrib.contenttypes'",
",",
"'django.contrib.sites'",
"]",
"... | [
1138,
4
] | [
1151,
82
] | python | en | ['en', 'en', 'en'] | True |
ManageCheck.test_output_format | (self) | All errors/warnings should be sorted by level and by message. | All errors/warnings should be sorted by level and by message. | def test_output_format(self):
""" All errors/warnings should be sorted by level and by message. """
self.write_settings('settings.py',
apps=['admin_scripts.app_raising_messages',
'django.contrib.auth',
'django.contrib.contenttypes'],
sdict={'D... | [
"def",
"test_output_format",
"(",
"self",
")",
":",
"self",
".",
"write_settings",
"(",
"'settings.py'",
",",
"apps",
"=",
"[",
"'admin_scripts.app_raising_messages'",
",",
"'django.contrib.auth'",
",",
"'django.contrib.contenttypes'",
"]",
",",
"sdict",
"=",
"{",
"... | [
1153,
4
] | [
1178,
32
] | python | en | ['en', 'en', 'en'] | True |
ManageCheck.test_warning_does_not_halt | (self) |
When there are only warnings or less serious messages, then Django
should not prevent user from launching their project, so `check`
command should not raise `CommandError` exception.
In this test we also test output format.
|
When there are only warnings or less serious messages, then Django
should not prevent user from launching their project, so `check`
command should not raise `CommandError` exception. | def test_warning_does_not_halt(self):
"""
When there are only warnings or less serious messages, then Django
should not prevent user from launching their project, so `check`
command should not raise `CommandError` exception.
In this test we also test output format.
"""
... | [
"def",
"test_warning_does_not_halt",
"(",
"self",
")",
":",
"self",
".",
"write_settings",
"(",
"'settings.py'",
",",
"apps",
"=",
"[",
"'admin_scripts.app_raising_warning'",
",",
"'django.contrib.auth'",
",",
"'django.contrib.contenttypes'",
"]",
",",
"sdict",
"=",
"... | [
1180,
4
] | [
1206,
32
] | python | en | ['en', 'error', 'th'] | False |
ManageTestCommand.test_liveserver | (self) |
Ensure that the --liveserver option sets the environment variable
correctly.
Refs #2879.
|
Ensure that the --liveserver option sets the environment variable
correctly.
Refs #2879.
| def test_liveserver(self):
"""
Ensure that the --liveserver option sets the environment variable
correctly.
Refs #2879.
"""
# Backup original state
address_predefined = 'DJANGO_LIVE_TEST_SERVER_ADDRESS' in os.environ
old_address = os.environ.get('DJANGO_L... | [
"def",
"test_liveserver",
"(",
"self",
")",
":",
"# Backup original state",
"address_predefined",
"=",
"'DJANGO_LIVE_TEST_SERVER_ADDRESS'",
"in",
"os",
".",
"environ",
"old_address",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'DJANGO_LIVE_TEST_SERVER_ADDRESS'",
")",
... | [
1224,
4
] | [
1251,
61
] | python | en | ['en', 'error', 'th'] | False |
CommandTypes.test_version | (self) | version is handled as a special case | version is handled as a special case | def test_version(self):
"version is handled as a special case"
args = ['version']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, get_version()) | [
"def",
"test_version",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'version'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
")",
"self",
".",
"assertOutput",
"(",
"out",
",",
"get_... | [
1343,
4
] | [
1348,
45
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_version_alternative | (self) | --version is equivalent to version | --version is equivalent to version | def test_version_alternative(self):
"--version is equivalent to version"
args1, args2 = ['version'], ['--version']
# It's possible one outputs on stderr and the other on stdout, hence the set
self.assertEqual(set(self.run_manage(args1)), set(self.run_manage(args2))) | [
"def",
"test_version_alternative",
"(",
"self",
")",
":",
"args1",
",",
"args2",
"=",
"[",
"'version'",
"]",
",",
"[",
"'--version'",
"]",
"# It's possible one outputs on stderr and the other on stdout, hence the set",
"self",
".",
"assertEqual",
"(",
"set",
"(",
"sel... | [
1350,
4
] | [
1354,
82
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_help | (self) | help is handled as a special case | help is handled as a special case | def test_help(self):
"help is handled as a special case"
args = ['help']
out, err = self.run_manage(args)
self.assertOutput(out, "Type 'manage.py help <subcommand>' for help on a specific subcommand.")
self.assertOutput(out, '[django]')
self.assertOutput(out, 'startapp')
... | [
"def",
"test_help",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'help'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertOutput",
"(",
"out",
",",
"\"Type 'manage.py help <subcommand>' for help on a specific subcommand... | [
1356,
4
] | [
1363,
46
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_help_commands | (self) | help --commands shows the list of all available commands | help --commands shows the list of all available commands | def test_help_commands(self):
"help --commands shows the list of all available commands"
args = ['help', '--commands']
out, err = self.run_manage(args)
self.assertNotInOutput(out, 'usage:')
self.assertNotInOutput(out, 'Options:')
self.assertNotInOutput(out, '[django]')
... | [
"def",
"test_help_commands",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'help'",
",",
"'--commands'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNotInOutput",
"(",
"out",
",",
"'usage:'",
")",
"self",
"... | [
1365,
4
] | [
1374,
43
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_help_alternative | (self) | --help is equivalent to help | --help is equivalent to help | def test_help_alternative(self):
"--help is equivalent to help"
args1, args2 = ['help'], ['--help']
self.assertEqual(self.run_manage(args1), self.run_manage(args2)) | [
"def",
"test_help_alternative",
"(",
"self",
")",
":",
"args1",
",",
"args2",
"=",
"[",
"'help'",
"]",
",",
"[",
"'--help'",
"]",
"self",
".",
"assertEqual",
"(",
"self",
".",
"run_manage",
"(",
"args1",
")",
",",
"self",
".",
"run_manage",
"(",
"args2... | [
1376,
4
] | [
1379,
72
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_help_short_altert | (self) | -h is handled as a short form of --help | -h is handled as a short form of --help | def test_help_short_altert(self):
"-h is handled as a short form of --help"
args1, args2 = ['--help'], ['-h']
self.assertEqual(self.run_manage(args1), self.run_manage(args2)) | [
"def",
"test_help_short_altert",
"(",
"self",
")",
":",
"args1",
",",
"args2",
"=",
"[",
"'--help'",
"]",
",",
"[",
"'-h'",
"]",
"self",
".",
"assertEqual",
"(",
"self",
".",
"run_manage",
"(",
"args1",
")",
",",
"self",
".",
"run_manage",
"(",
"args2"... | [
1381,
4
] | [
1384,
72
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_specific_help | (self) | --help can be used on a specific command | --help can be used on a specific command | def test_specific_help(self):
"--help can be used on a specific command"
args = ['sqlall', '--help']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, "Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the\ngiven model module n... | [
"def",
"test_specific_help",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'sqlall'",
",",
"'--help'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
")",
"self",
".",
"assertOutput",
"(... | [
1386,
4
] | [
1392,
60
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_no_color | (self) | --no-color prevent colorization of the output | --no-color prevent colorization of the output | def test_no_color(self):
"--no-color prevent colorization of the output"
out = StringIO()
call_command('color_command', no_color=True, stdout=out)
self.assertEqual(os.environ.get('DJANGO_COLORS', ''), 'nocolor')
self.assertEqual(out.getvalue(), 'BEGIN\n') | [
"def",
"test_no_color",
"(",
"self",
")",
":",
"out",
"=",
"StringIO",
"(",
")",
"call_command",
"(",
"'color_command'",
",",
"no_color",
"=",
"True",
",",
"stdout",
"=",
"out",
")",
"self",
".",
"assertEqual",
"(",
"os",
".",
"environ",
".",
"get",
"(... | [
1394,
4
] | [
1400,
51
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_base_command | (self) | User BaseCommands can execute when a label is provided | User BaseCommands can execute when a label is provided | def test_base_command(self):
"User BaseCommands can execute when a label is provided"
args = ['base_command', 'testlabel']
expected_labels = "('testlabel',)"
self._test_base_command(args, expected_labels) | [
"def",
"test_base_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'base_command'",
",",
"'testlabel'",
"]",
"expected_labels",
"=",
"\"('testlabel',)\"",
"self",
".",
"_test_base_command",
"(",
"args",
",",
"expected_labels",
")"
] | [
1402,
4
] | [
1406,
54
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_base_command_no_label | (self) | User BaseCommands can execute when no labels are provided | User BaseCommands can execute when no labels are provided | def test_base_command_no_label(self):
"User BaseCommands can execute when no labels are provided"
args = ['base_command']
expected_labels = "()"
self._test_base_command(args, expected_labels) | [
"def",
"test_base_command_no_label",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'base_command'",
"]",
"expected_labels",
"=",
"\"()\"",
"self",
".",
"_test_base_command",
"(",
"args",
",",
"expected_labels",
")"
] | [
1408,
4
] | [
1412,
54
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_base_command_multiple_label | (self) | User BaseCommands can execute when no labels are provided | User BaseCommands can execute when no labels are provided | def test_base_command_multiple_label(self):
"User BaseCommands can execute when no labels are provided"
args = ['base_command', 'testlabel', 'anotherlabel']
expected_labels = "('testlabel', 'anotherlabel')"
self._test_base_command(args, expected_labels) | [
"def",
"test_base_command_multiple_label",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'base_command'",
",",
"'testlabel'",
",",
"'anotherlabel'",
"]",
"expected_labels",
"=",
"\"('testlabel', 'anotherlabel')\"",
"self",
".",
"_test_base_command",
"(",
"args",
",",
"exp... | [
1414,
4
] | [
1418,
54
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_base_command_with_option | (self) | User BaseCommands can execute with options when a label is provided | User BaseCommands can execute with options when a label is provided | def test_base_command_with_option(self):
"User BaseCommands can execute with options when a label is provided"
args = ['base_command', 'testlabel', '--option_a=x']
expected_labels = "('testlabel',)"
self._test_base_command(args, expected_labels, option_a="'x'") | [
"def",
"test_base_command_with_option",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'base_command'",
",",
"'testlabel'",
",",
"'--option_a=x'",
"]",
"expected_labels",
"=",
"\"('testlabel',)\"",
"self",
".",
"_test_base_command",
"(",
"args",
",",
"expected_labels",
"... | [
1420,
4
] | [
1424,
70
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_base_command_with_options | (self) | User BaseCommands can execute with multiple options when a label is provided | User BaseCommands can execute with multiple options when a label is provided | def test_base_command_with_options(self):
"User BaseCommands can execute with multiple options when a label is provided"
args = ['base_command', 'testlabel', '-a', 'x', '--option_b=y']
expected_labels = "('testlabel',)"
self._test_base_command(args, expected_labels, option_a="'x'", optio... | [
"def",
"test_base_command_with_options",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'base_command'",
",",
"'testlabel'",
",",
"'-a'",
",",
"'x'",
",",
"'--option_b=y'",
"]",
"expected_labels",
"=",
"\"('testlabel',)\"",
"self",
".",
"_test_base_command",
"(",
"args... | [
1426,
4
] | [
1430,
86
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_base_command_with_wrong_option | (self) | User BaseCommands outputs command usage when wrong option is specified | User BaseCommands outputs command usage when wrong option is specified | def test_base_command_with_wrong_option(self):
"User BaseCommands outputs command usage when wrong option is specified"
args = ['base_command', '--invalid']
out, err = self.run_manage(args)
self.assertNoOutput(out)
self.assertOutput(err, "usage: manage.py base_command")
s... | [
"def",
"test_base_command_with_wrong_option",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'base_command'",
",",
"'--invalid'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"out",
")",
"self",
"... | [
1432,
4
] | [
1438,
74
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_base_run_from_argv | (self) |
Test run_from_argv properly terminates even with custom execute() (#19665)
Also test proper traceback display.
|
Test run_from_argv properly terminates even with custom execute() (#19665)
Also test proper traceback display.
| def test_base_run_from_argv(self):
"""
Test run_from_argv properly terminates even with custom execute() (#19665)
Also test proper traceback display.
"""
command = BaseCommand()
def raise_command_error(*args, **kwargs):
raise CommandError("Custom error")
... | [
"def",
"test_base_run_from_argv",
"(",
"self",
")",
":",
"command",
"=",
"BaseCommand",
"(",
")",
"def",
"raise_command_error",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"raise",
"CommandError",
"(",
"\"Custom error\"",
")",
"old_stderr",
"=",
"sy... | [
1451,
4
] | [
1489,
35
] | python | en | ['en', 'error', 'th'] | False |
CommandTypes.test_run_from_argv_non_ascii_error | (self) |
Test that non-ASCII message of CommandError does not raise any
UnicodeDecodeError in run_from_argv.
|
Test that non-ASCII message of CommandError does not raise any
UnicodeDecodeError in run_from_argv.
| def test_run_from_argv_non_ascii_error(self):
"""
Test that non-ASCII message of CommandError does not raise any
UnicodeDecodeError in run_from_argv.
"""
def raise_command_error(*args, **kwargs):
raise CommandError("Erreur personnalisée")
command = BaseComman... | [
"def",
"test_run_from_argv_non_ascii_error",
"(",
"self",
")",
":",
"def",
"raise_command_error",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"raise",
"CommandError",
"(",
"\"Erreur personnalisée\")",
"",
"command",
"=",
"BaseCommand",
"(",
")",
"comman... | [
1491,
4
] | [
1504,
43
] | python | en | ['en', 'error', 'th'] | False |
CommandTypes.test_noargs | (self) | NoArg Commands can be executed | NoArg Commands can be executed | def test_noargs(self):
"NoArg Commands can be executed"
args = ['noargs_command']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, "EXECUTE: noargs_command options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', False)... | [
"def",
"test_noargs",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
")",
"self",
".",
"assertOutput",
"(",
"out",
",",
... | [
1506,
4
] | [
1511,
169
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_noargs_with_args | (self) | NoArg Commands raise an error if an argument is provided | NoArg Commands raise an error if an argument is provided | def test_noargs_with_args(self):
"NoArg Commands raise an error if an argument is provided"
args = ['noargs_command', 'argument']
out, err = self.run_manage(args)
self.assertOutput(err, "error: unrecognized arguments: argument") | [
"def",
"test_noargs_with_args",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'noargs_command'",
",",
"'argument'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertOutput",
"(",
"err",
",",
"\"error: unrecognized arg... | [
1513,
4
] | [
1517,
73
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_app_command | (self) | User AppCommands can execute when a single app name is provided | User AppCommands can execute when a single app name is provided | def test_app_command(self):
"User AppCommands can execute when a single app name is provided"
args = ['app_command', 'auth']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, "EXECUTE:AppCommand name=django.contrib.auth, options=")
self.asse... | [
"def",
"test_app_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'app_command'",
",",
"'auth'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
")",
"self",
".",
"assertOutput",
"... | [
1519,
4
] | [
1525,
147
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_app_command_no_apps | (self) | User AppCommands raise an error when no app name is provided | User AppCommands raise an error when no app name is provided | def test_app_command_no_apps(self):
"User AppCommands raise an error when no app name is provided"
args = ['app_command']
out, err = self.run_manage(args)
self.assertOutput(err, 'error: Enter at least one application label.') | [
"def",
"test_app_command_no_apps",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'app_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertOutput",
"(",
"err",
",",
"'error: Enter at least one application label.'",... | [
1527,
4
] | [
1531,
78
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_app_command_multiple_apps | (self) | User AppCommands raise an error when multiple app names are provided | User AppCommands raise an error when multiple app names are provided | def test_app_command_multiple_apps(self):
"User AppCommands raise an error when multiple app names are provided"
args = ['app_command', 'auth', 'contenttypes']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, "EXECUTE:AppCommand name=django.contrib... | [
"def",
"test_app_command_multiple_apps",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'app_command'",
",",
"'auth'",
",",
"'contenttypes'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
")... | [
1533,
4
] | [
1541,
147
] | python | en | ['en', 'no', 'en'] | True |
CommandTypes.test_app_command_invalid_app_label | (self) | User AppCommands can execute when a single app name is provided | User AppCommands can execute when a single app name is provided | def test_app_command_invalid_app_label(self):
"User AppCommands can execute when a single app name is provided"
args = ['app_command', 'NOT_AN_APP']
out, err = self.run_manage(args)
self.assertOutput(err, "No installed app with label 'NOT_AN_APP'.") | [
"def",
"test_app_command_invalid_app_label",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'app_command'",
",",
"'NOT_AN_APP'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertOutput",
"(",
"err",
",",
"\"No installe... | [
1543,
4
] | [
1547,
75
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_app_command_some_invalid_app_labels | (self) | User AppCommands can execute when some of the provided app names are invalid | User AppCommands can execute when some of the provided app names are invalid | def test_app_command_some_invalid_app_labels(self):
"User AppCommands can execute when some of the provided app names are invalid"
args = ['app_command', 'auth', 'NOT_AN_APP']
out, err = self.run_manage(args)
self.assertOutput(err, "No installed app with label 'NOT_AN_APP'.") | [
"def",
"test_app_command_some_invalid_app_labels",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'app_command'",
",",
"'auth'",
",",
"'NOT_AN_APP'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertOutput",
"(",
"err"... | [
1549,
4
] | [
1553,
75
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_label_command | (self) | User LabelCommands can execute when a label is provided | User LabelCommands can execute when a label is provided | def test_label_command(self):
"User LabelCommands can execute when a label is provided"
args = ['label_command', 'testlabel']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, "EXECUTE:LabelCommand label=testlabel, options=[('no_color', False), ('py... | [
"def",
"test_label_command",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'label_command'",
",",
"'testlabel'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"err",
")",
"self",
".",
"assertOut... | [
1555,
4
] | [
1560,
183
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_label_command_no_label | (self) | User LabelCommands raise an error if no label is provided | User LabelCommands raise an error if no label is provided | def test_label_command_no_label(self):
"User LabelCommands raise an error if no label is provided"
args = ['label_command']
out, err = self.run_manage(args)
self.assertOutput(err, 'Enter at least one label') | [
"def",
"test_label_command_no_label",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'label_command'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertOutput",
"(",
"err",
",",
"'Enter at least one label'",
")"
] | [
1562,
4
] | [
1566,
58
] | python | en | ['en', 'en', 'en'] | True |
CommandTypes.test_label_command_multiple_label | (self) | User LabelCommands are executed multiple times if multiple labels are provided | User LabelCommands are executed multiple times if multiple labels are provided | def test_label_command_multiple_label(self):
"User LabelCommands are executed multiple times if multiple labels are provided"
args = ['label_command', 'testlabel', 'anotherlabel']
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, "EXECUTE:LabelComma... | [
"def",
"test_label_command_multiple_label",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'label_command'",
",",
"'testlabel'",
",",
"'anotherlabel'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertNoOutput",
"(",
"... | [
1568,
4
] | [
1574,
186
] | python | en | ['en', 'en', 'en'] | True |
Discovery.test_precedence | (self) |
Apps listed first in INSTALLED_APPS have precedence.
|
Apps listed first in INSTALLED_APPS have precedence.
| def test_precedence(self):
"""
Apps listed first in INSTALLED_APPS have precedence.
"""
with self.settings(INSTALLED_APPS=['admin_scripts.complex_app',
'admin_scripts.simple_app',
'django.contrib.auth',... | [
"def",
"test_precedence",
"(",
"self",
")",
":",
"with",
"self",
".",
"settings",
"(",
"INSTALLED_APPS",
"=",
"[",
"'admin_scripts.complex_app'",
",",
"'admin_scripts.simple_app'",
",",
"'django.contrib.auth'",
",",
"'django.contrib.contenttypes'",
"]",
")",
":",
"out... | [
1585,
4
] | [
1602,
66
] | python | en | ['en', 'error', 'th'] | False |
ArgumentOrder.test_setting_then_option | (self) | Options passed after settings are correctly handled. | Options passed after settings are correctly handled. | def test_setting_then_option(self):
""" Options passed after settings are correctly handled. """
args = ['base_command', 'testlabel', '--settings=alternate_settings', '--option_a=x']
self._test(args) | [
"def",
"test_setting_then_option",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'base_command'",
",",
"'testlabel'",
",",
"'--settings=alternate_settings'",
",",
"'--option_a=x'",
"]",
"self",
".",
"_test",
"(",
"args",
")"
] | [
1622,
4
] | [
1625,
24
] | python | en | ['en', 'en', 'en'] | True |
ArgumentOrder.test_setting_then_short_option | (self) | Short options passed after settings are correctly handled. | Short options passed after settings are correctly handled. | def test_setting_then_short_option(self):
""" Short options passed after settings are correctly handled. """
args = ['base_command', 'testlabel', '--settings=alternate_settings', '-a', 'x']
self._test(args) | [
"def",
"test_setting_then_short_option",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'base_command'",
",",
"'testlabel'",
",",
"'--settings=alternate_settings'",
",",
"'-a'",
",",
"'x'",
"]",
"self",
".",
"_test",
"(",
"args",
")"
] | [
1627,
4
] | [
1630,
24
] | python | en | ['en', 'en', 'en'] | True |
ArgumentOrder.test_option_then_setting | (self) | Options passed before settings are correctly handled. | Options passed before settings are correctly handled. | def test_option_then_setting(self):
""" Options passed before settings are correctly handled. """
args = ['base_command', 'testlabel', '--option_a=x', '--settings=alternate_settings']
self._test(args) | [
"def",
"test_option_then_setting",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'base_command'",
",",
"'testlabel'",
",",
"'--option_a=x'",
",",
"'--settings=alternate_settings'",
"]",
"self",
".",
"_test",
"(",
"args",
")"
] | [
1632,
4
] | [
1635,
24
] | python | en | ['en', 'en', 'en'] | True |
ArgumentOrder.test_short_option_then_setting | (self) | Short options passed before settings are correctly handled. | Short options passed before settings are correctly handled. | def test_short_option_then_setting(self):
""" Short options passed before settings are correctly handled. """
args = ['base_command', 'testlabel', '-a', 'x', '--settings=alternate_settings']
self._test(args) | [
"def",
"test_short_option_then_setting",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'base_command'",
",",
"'testlabel'",
",",
"'-a'",
",",
"'x'",
",",
"'--settings=alternate_settings'",
"]",
"self",
".",
"_test",
"(",
"args",
")"
] | [
1637,
4
] | [
1640,
24
] | python | en | ['en', 'en', 'en'] | True |
ArgumentOrder.test_option_then_setting_then_option | (self) | Options are correctly handled when they are passed before and after
a setting. | Options are correctly handled when they are passed before and after
a setting. | def test_option_then_setting_then_option(self):
""" Options are correctly handled when they are passed before and after
a setting. """
args = ['base_command', 'testlabel', '--option_a=x', '--settings=alternate_settings', '--option_b=y']
self._test(args, option_b="'y'") | [
"def",
"test_option_then_setting_then_option",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'base_command'",
",",
"'testlabel'",
",",
"'--option_a=x'",
",",
"'--settings=alternate_settings'",
",",
"'--option_b=y'",
"]",
"self",
".",
"_test",
"(",
"args",
",",
"option_b... | [
1642,
4
] | [
1646,
40
] | python | en | ['en', 'en', 'en'] | True |
DiffSettings.test_basic | (self) | Runs without error and emits settings diff. | Runs without error and emits settings diff. | def test_basic(self):
"""Runs without error and emits settings diff."""
self.write_settings('settings_to_diff.py', sdict={'FOO': '"bar"'})
self.addCleanup(self.remove_settings, 'settings_to_diff.py')
args = ['diffsettings', '--settings=settings_to_diff']
out, err = self.run_manag... | [
"def",
"test_basic",
"(",
"self",
")",
":",
"self",
".",
"write_settings",
"(",
"'settings_to_diff.py'",
",",
"sdict",
"=",
"{",
"'FOO'",
":",
"'\"bar\"'",
"}",
")",
"self",
".",
"addCleanup",
"(",
"self",
".",
"remove_settings",
",",
"'settings_to_diff.py'",
... | [
1872,
4
] | [
1879,
50
] | python | en | ['en', 'en', 'en'] | True |
DiffSettings.test_all | (self) | The all option also shows settings with the default value. | The all option also shows settings with the default value. | def test_all(self):
"""The all option also shows settings with the default value."""
self.write_settings('settings_to_diff.py', sdict={'STATIC_URL': 'None'})
self.addCleanup(self.remove_settings, 'settings_to_diff.py')
args = ['diffsettings', '--settings=settings_to_diff', '--all']
... | [
"def",
"test_all",
"(",
"self",
")",
":",
"self",
".",
"write_settings",
"(",
"'settings_to_diff.py'",
",",
"sdict",
"=",
"{",
"'STATIC_URL'",
":",
"'None'",
"}",
")",
"self",
".",
"addCleanup",
"(",
"self",
".",
"remove_settings",
",",
"'settings_to_diff.py'"... | [
1881,
4
] | [
1888,
55
] | python | en | ['en', 'en', 'en'] | True |
Dumpdata.test_pks_parsing | (self) | Regression for #20509
Test would raise an exception rather than printing an error message.
| Regression for #20509 | def test_pks_parsing(self):
"""Regression for #20509
Test would raise an exception rather than printing an error message.
"""
args = ['dumpdata', '--pks=1']
out, err = self.run_manage(args)
self.assertOutput(err, "You can only use --pks option with one model")
se... | [
"def",
"test_pks_parsing",
"(",
"self",
")",
":",
"args",
"=",
"[",
"'dumpdata'",
",",
"'--pks=1'",
"]",
"out",
",",
"err",
"=",
"self",
".",
"run_manage",
"(",
"args",
")",
"self",
".",
"assertOutput",
"(",
"err",
",",
"\"You can only use --pks option with ... | [
1900,
4
] | [
1908,
32
] | python | en | ['en', 'en', 'en'] | True |
get_default_compiler | (osname=None, platform=None) | Determine the default compiler to use for the given platform.
osname should be one of the standard Python OS names (i.e. the
ones returned by os.name) and platform the common value
returned by sys.platform for the platform in question.
The default values are os.name and sys.platform in cas... | Determine the default compiler to use for the given platform. | def get_default_compiler(osname=None, platform=None):
"""Determine the default compiler to use for the given platform.
osname should be one of the standard Python OS names (i.e. the
ones returned by os.name) and platform the common value
returned by sys.platform for the platform in question.
... | [
"def",
"get_default_compiler",
"(",
"osname",
"=",
"None",
",",
"platform",
"=",
"None",
")",
":",
"if",
"osname",
"is",
"None",
":",
"osname",
"=",
"os",
".",
"name",
"if",
"platform",
"is",
"None",
":",
"platform",
"=",
"sys",
".",
"platform",
"for",... | [
936,
0
] | [
955,
17
] | python | en | ['en', 'en', 'en'] | True |
show_compilers | () | Print list of available compilers (used by the "--help-compiler"
options to "build", "build_ext", "build_clib").
| Print list of available compilers (used by the "--help-compiler"
options to "build", "build_ext", "build_clib").
| def show_compilers():
"""Print list of available compilers (used by the "--help-compiler"
options to "build", "build_ext", "build_clib").
"""
# XXX this "knows" that the compiler option it's describing is
# "--compiler", which just happens to be the case for the three
# commands that use it.
... | [
"def",
"show_compilers",
"(",
")",
":",
"# XXX this \"knows\" that the compiler option it's describing is",
"# \"--compiler\", which just happens to be the case for the three",
"# commands that use it.",
"from",
"distutils",
".",
"fancy_getopt",
"import",
"FancyGetopt",
"compilers",
"=... | [
972,
0
] | [
986,
61
] | python | en | ['en', 'en', 'en'] | True |
new_compiler | (plat=None, compiler=None, verbose=0, dry_run=0, force=0) | Generate an instance of some CCompiler subclass for the supplied
platform/compiler combination. 'plat' defaults to 'os.name'
(eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler
for that platform. Currently only 'posix' and 'nt' are supported, and
the default compilers are "traditional... | Generate an instance of some CCompiler subclass for the supplied
platform/compiler combination. 'plat' defaults to 'os.name'
(eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler
for that platform. Currently only 'posix' and 'nt' are supported, and
the default compilers are "traditional... | def new_compiler(plat=None, compiler=None, verbose=0, dry_run=0, force=0):
"""Generate an instance of some CCompiler subclass for the supplied
platform/compiler combination. 'plat' defaults to 'os.name'
(eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler
for that platform. Currently o... | [
"def",
"new_compiler",
"(",
"plat",
"=",
"None",
",",
"compiler",
"=",
"None",
",",
"verbose",
"=",
"0",
",",
"dry_run",
"=",
"0",
",",
"force",
"=",
"0",
")",
":",
"if",
"plat",
"is",
"None",
":",
"plat",
"=",
"os",
".",
"name",
"try",
":",
"i... | [
989,
0
] | [
1031,
38
] | python | en | ['en', 'en', 'en'] | True |
gen_preprocess_options | (macros, include_dirs) | Generate C pre-processor options (-D, -U, -I) as used by at least
two types of compilers: the typical Unix compiler and Visual C++.
'macros' is the usual thing, a list of 1- or 2-tuples, where (name,)
means undefine (-U) macro 'name', and (name,value) means define (-D)
macro 'name' to 'value'. 'include... | Generate C pre-processor options (-D, -U, -I) as used by at least
two types of compilers: the typical Unix compiler and Visual C++.
'macros' is the usual thing, a list of 1- or 2-tuples, where (name,)
means undefine (-U) macro 'name', and (name,value) means define (-D)
macro 'name' to 'value'. 'include... | def gen_preprocess_options(macros, include_dirs):
"""Generate C pre-processor options (-D, -U, -I) as used by at least
two types of compilers: the typical Unix compiler and Visual C++.
'macros' is the usual thing, a list of 1- or 2-tuples, where (name,)
means undefine (-U) macro 'name', and (name,value)... | [
"def",
"gen_preprocess_options",
"(",
"macros",
",",
"include_dirs",
")",
":",
"# XXX it would be nice (mainly aesthetic, and so we don't generate",
"# stupid-looking command lines) to go over 'macros' and eliminate",
"# redundant definitions/undefinitions (ie. ensure that only the",
"# latest... | [
1034,
0
] | [
1076,
18
] | python | en | ['en', 'en', 'en'] | True |
gen_lib_options | (compiler, library_dirs, runtime_library_dirs, libraries) | Generate linker options for searching library directories and
linking with specific libraries. 'libraries' and 'library_dirs' are,
respectively, lists of library names (not filenames!) and search
directories. Returns a list of command-line options suitable for use
with some compiler (depending on the ... | Generate linker options for searching library directories and
linking with specific libraries. 'libraries' and 'library_dirs' are,
respectively, lists of library names (not filenames!) and search
directories. Returns a list of command-line options suitable for use
with some compiler (depending on the ... | def gen_lib_options (compiler, library_dirs, runtime_library_dirs, libraries):
"""Generate linker options for searching library directories and
linking with specific libraries. 'libraries' and 'library_dirs' are,
respectively, lists of library names (not filenames!) and search
directories. Returns a l... | [
"def",
"gen_lib_options",
"(",
"compiler",
",",
"library_dirs",
",",
"runtime_library_dirs",
",",
"libraries",
")",
":",
"lib_opts",
"=",
"[",
"]",
"for",
"dir",
"in",
"library_dirs",
":",
"lib_opts",
".",
"append",
"(",
"compiler",
".",
"library_dir_option",
... | [
1079,
0
] | [
1115,
19
] | python | en | ['en', 'en', 'en'] | True |
CCompiler.set_executables | (self, **kwargs) | Define the executables (and options for them) that will be run
to perform the various stages of compilation. The exact set of
executables that may be specified here depends on the compiler
class (via the 'executables' class attribute), but most will have:
compiler the C/C++ compi... | Define the executables (and options for them) that will be run
to perform the various stages of compilation. The exact set of
executables that may be specified here depends on the compiler
class (via the 'executables' class attribute), but most will have:
compiler the C/C++ compi... | def set_executables(self, **kwargs):
"""Define the executables (and options for them) that will be run
to perform the various stages of compilation. The exact set of
executables that may be specified here depends on the compiler
class (via the 'executables' class attribute), but most wi... | [
"def",
"set_executables",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# Note that some CCompiler implementation classes will define class",
"# attributes 'cpp', 'cc', etc. with hard-coded executable names;",
"# this is appropriate when a compiler class is for exactly one",
"# compiler... | [
120,
4
] | [
150,
49
] | python | en | ['en', 'en', 'en'] | True |
CCompiler._check_macro_definitions | (self, definitions) | Ensures that every element of 'definitions' is a valid macro
definition, ie. either (name,value) 2-tuple or a (name,) tuple. Do
nothing if all definitions are OK, raise TypeError otherwise.
| Ensures that every element of 'definitions' is a valid macro
definition, ie. either (name,value) 2-tuple or a (name,) tuple. Do
nothing if all definitions are OK, raise TypeError otherwise.
| def _check_macro_definitions(self, definitions):
"""Ensures that every element of 'definitions' is a valid macro
definition, ie. either (name,value) 2-tuple or a (name,) tuple. Do
nothing if all definitions are OK, raise TypeError otherwise.
"""
for defn in definitions:
... | [
"def",
"_check_macro_definitions",
"(",
"self",
",",
"definitions",
")",
":",
"for",
"defn",
"in",
"definitions",
":",
"if",
"not",
"(",
"isinstance",
"(",
"defn",
",",
"tuple",
")",
"and",
"(",
"len",
"(",
"defn",
")",
"in",
"(",
"1",
",",
"2",
")",... | [
166,
4
] | [
178,
39
] | python | en | ['en', 'en', 'en'] | True |
CCompiler.define_macro | (self, name, value=None) | Define a preprocessor macro for all compilations driven by this
compiler object. The optional parameter 'value' should be a
string; if it is not supplied, then the macro will be defined
without an explicit value and the exact outcome depends on the
compiler used (XXX true? does ANSI say... | Define a preprocessor macro for all compilations driven by this
compiler object. The optional parameter 'value' should be a
string; if it is not supplied, then the macro will be defined
without an explicit value and the exact outcome depends on the
compiler used (XXX true? does ANSI say... | def define_macro(self, name, value=None):
"""Define a preprocessor macro for all compilations driven by this
compiler object. The optional parameter 'value' should be a
string; if it is not supplied, then the macro will be defined
without an explicit value and the exact outcome depends ... | [
"def",
"define_macro",
"(",
"self",
",",
"name",
",",
"value",
"=",
"None",
")",
":",
"# Delete from the list of macro definitions/undefinitions if",
"# already there (so that this one will take precedence).",
"i",
"=",
"self",
".",
"_find_macro",
"(",
"name",
")",
"if",
... | [
183,
4
] | [
196,
41
] | python | en | ['en', 'en', 'en'] | True |
CCompiler.undefine_macro | (self, name) | Undefine a preprocessor macro for all compilations driven by
this compiler object. If the same macro is defined by
'define_macro()' and undefined by 'undefine_macro()' the last call
takes precedence (including multiple redefinitions or
undefinitions). If the macro is redefined/undefine... | Undefine a preprocessor macro for all compilations driven by
this compiler object. If the same macro is defined by
'define_macro()' and undefined by 'undefine_macro()' the last call
takes precedence (including multiple redefinitions or
undefinitions). If the macro is redefined/undefine... | def undefine_macro(self, name):
"""Undefine a preprocessor macro for all compilations driven by
this compiler object. If the same macro is defined by
'define_macro()' and undefined by 'undefine_macro()' the last call
takes precedence (including multiple redefinitions or
undefini... | [
"def",
"undefine_macro",
"(",
"self",
",",
"name",
")",
":",
"# Delete from the list of macro definitions/undefinitions if",
"# already there (so that this one will take precedence).",
"i",
"=",
"self",
".",
"_find_macro",
"(",
"name",
")",
"if",
"i",
"is",
"not",
"None",... | [
198,
4
] | [
214,
34
] | python | en | ['en', 'en', 'en'] | True |
CCompiler.add_include_dir | (self, dir) | Add 'dir' to the list of directories that will be searched for
header files. The compiler is instructed to search directories in
the order in which they are supplied by successive calls to
'add_include_dir()'.
| Add 'dir' to the list of directories that will be searched for
header files. The compiler is instructed to search directories in
the order in which they are supplied by successive calls to
'add_include_dir()'.
| def add_include_dir(self, dir):
"""Add 'dir' to the list of directories that will be searched for
header files. The compiler is instructed to search directories in
the order in which they are supplied by successive calls to
'add_include_dir()'.
"""
self.include_dirs.appe... | [
"def",
"add_include_dir",
"(",
"self",
",",
"dir",
")",
":",
"self",
".",
"include_dirs",
".",
"append",
"(",
"dir",
")"
] | [
216,
4
] | [
222,
37
] | python | en | ['en', 'en', 'en'] | True |
CCompiler.set_include_dirs | (self, dirs) | Set the list of directories that will be searched to 'dirs' (a
list of strings). Overrides any preceding calls to
'add_include_dir()'; subsequence calls to 'add_include_dir()' add
to the list passed to 'set_include_dirs()'. This does not affect
any list of standard include directories ... | Set the list of directories that will be searched to 'dirs' (a
list of strings). Overrides any preceding calls to
'add_include_dir()'; subsequence calls to 'add_include_dir()' add
to the list passed to 'set_include_dirs()'. This does not affect
any list of standard include directories ... | def set_include_dirs(self, dirs):
"""Set the list of directories that will be searched to 'dirs' (a
list of strings). Overrides any preceding calls to
'add_include_dir()'; subsequence calls to 'add_include_dir()' add
to the list passed to 'set_include_dirs()'. This does not affect
... | [
"def",
"set_include_dirs",
"(",
"self",
",",
"dirs",
")",
":",
"self",
".",
"include_dirs",
"=",
"dirs",
"[",
":",
"]"
] | [
224,
4
] | [
232,
35
] | python | en | ['en', 'en', 'en'] | True |
CCompiler.add_library | (self, libname) | Add 'libname' to the list of libraries that will be included in
all links driven by this compiler object. Note that 'libname'
should *not* be the name of a file containing a library, but the
name of the library itself: the actual filename will be inferred by
the linker, the compiler, or... | Add 'libname' to the list of libraries that will be included in
all links driven by this compiler object. Note that 'libname'
should *not* be the name of a file containing a library, but the
name of the library itself: the actual filename will be inferred by
the linker, the compiler, or... | def add_library(self, libname):
"""Add 'libname' to the list of libraries that will be included in
all links driven by this compiler object. Note that 'libname'
should *not* be the name of a file containing a library, but the
name of the library itself: the actual filename will be infer... | [
"def",
"add_library",
"(",
"self",
",",
"libname",
")",
":",
"self",
".",
"libraries",
".",
"append",
"(",
"libname",
")"
] | [
234,
4
] | [
248,
38
] | python | en | ['en', 'en', 'en'] | True |
CCompiler.set_libraries | (self, libnames) | Set the list of libraries to be included in all links driven by
this compiler object to 'libnames' (a list of strings). This does
not affect any standard system libraries that the linker may
include by default.
| Set the list of libraries to be included in all links driven by
this compiler object to 'libnames' (a list of strings). This does
not affect any standard system libraries that the linker may
include by default.
| def set_libraries(self, libnames):
"""Set the list of libraries to be included in all links driven by
this compiler object to 'libnames' (a list of strings). This does
not affect any standard system libraries that the linker may
include by default.
"""
self.libraries = l... | [
"def",
"set_libraries",
"(",
"self",
",",
"libnames",
")",
":",
"self",
".",
"libraries",
"=",
"libnames",
"[",
":",
"]"
] | [
250,
4
] | [
256,
36
] | python | en | ['en', 'en', 'en'] | True |
CCompiler.add_library_dir | (self, dir) | Add 'dir' to the list of directories that will be searched for
libraries specified to 'add_library()' and 'set_libraries()'. The
linker will be instructed to search for libraries in the order they
are supplied to 'add_library_dir()' and/or 'set_library_dirs()'.
| Add 'dir' to the list of directories that will be searched for
libraries specified to 'add_library()' and 'set_libraries()'. The
linker will be instructed to search for libraries in the order they
are supplied to 'add_library_dir()' and/or 'set_library_dirs()'.
| def add_library_dir(self, dir):
"""Add 'dir' to the list of directories that will be searched for
libraries specified to 'add_library()' and 'set_libraries()'. The
linker will be instructed to search for libraries in the order they
are supplied to 'add_library_dir()' and/or 'set_library... | [
"def",
"add_library_dir",
"(",
"self",
",",
"dir",
")",
":",
"self",
".",
"library_dirs",
".",
"append",
"(",
"dir",
")"
] | [
258,
4
] | [
264,
37
] | python | en | ['en', 'en', 'en'] | True |
CCompiler.set_library_dirs | (self, dirs) | Set the list of library search directories to 'dirs' (a list of
strings). This does not affect any standard library search path
that the linker may search by default.
| Set the list of library search directories to 'dirs' (a list of
strings). This does not affect any standard library search path
that the linker may search by default.
| def set_library_dirs(self, dirs):
"""Set the list of library search directories to 'dirs' (a list of
strings). This does not affect any standard library search path
that the linker may search by default.
"""
self.library_dirs = dirs[:] | [
"def",
"set_library_dirs",
"(",
"self",
",",
"dirs",
")",
":",
"self",
".",
"library_dirs",
"=",
"dirs",
"[",
":",
"]"
] | [
266,
4
] | [
271,
35
] | python | en | ['en', 'en', 'en'] | True |
CCompiler.add_runtime_library_dir | (self, dir) | Add 'dir' to the list of directories that will be searched for
shared libraries at runtime.
| Add 'dir' to the list of directories that will be searched for
shared libraries at runtime.
| def add_runtime_library_dir(self, dir):
"""Add 'dir' to the list of directories that will be searched for
shared libraries at runtime.
"""
self.runtime_library_dirs.append(dir) | [
"def",
"add_runtime_library_dir",
"(",
"self",
",",
"dir",
")",
":",
"self",
".",
"runtime_library_dirs",
".",
"append",
"(",
"dir",
")"
] | [
273,
4
] | [
277,
45
] | python | en | ['en', 'en', 'en'] | True |
CCompiler.set_runtime_library_dirs | (self, dirs) | Set the list of directories to search for shared libraries at
runtime to 'dirs' (a list of strings). This does not affect any
standard search path that the runtime linker may search by
default.
| Set the list of directories to search for shared libraries at
runtime to 'dirs' (a list of strings). This does not affect any
standard search path that the runtime linker may search by
default.
| def set_runtime_library_dirs(self, dirs):
"""Set the list of directories to search for shared libraries at
runtime to 'dirs' (a list of strings). This does not affect any
standard search path that the runtime linker may search by
default.
"""
self.runtime_library_dirs = ... | [
"def",
"set_runtime_library_dirs",
"(",
"self",
",",
"dirs",
")",
":",
"self",
".",
"runtime_library_dirs",
"=",
"dirs",
"[",
":",
"]"
] | [
279,
4
] | [
285,
43
] | python | en | ['en', 'en', 'en'] | True |
CCompiler.add_link_object | (self, object) | Add 'object' to the list of object files (or analogues, such as
explicitly named library files or the output of "resource
compilers") to be included in every link driven by this compiler
object.
| Add 'object' to the list of object files (or analogues, such as
explicitly named library files or the output of "resource
compilers") to be included in every link driven by this compiler
object.
| def add_link_object(self, object):
"""Add 'object' to the list of object files (or analogues, such as
explicitly named library files or the output of "resource
compilers") to be included in every link driven by this compiler
object.
"""
self.objects.append(object) | [
"def",
"add_link_object",
"(",
"self",
",",
"object",
")",
":",
"self",
".",
"objects",
".",
"append",
"(",
"object",
")"
] | [
287,
4
] | [
293,
35
] | python | en | ['en', 'en', 'en'] | True |
CCompiler.set_link_objects | (self, objects) | Set the list of object files (or analogues) to be included in
every link to 'objects'. This does not affect any standard object
files that the linker may include by default (such as system
libraries).
| Set the list of object files (or analogues) to be included in
every link to 'objects'. This does not affect any standard object
files that the linker may include by default (such as system
libraries).
| def set_link_objects(self, objects):
"""Set the list of object files (or analogues) to be included in
every link to 'objects'. This does not affect any standard object
files that the linker may include by default (such as system
libraries).
"""
self.objects = objects[:] | [
"def",
"set_link_objects",
"(",
"self",
",",
"objects",
")",
":",
"self",
".",
"objects",
"=",
"objects",
"[",
":",
"]"
] | [
295,
4
] | [
301,
33
] | python | en | ['en', 'en', 'en'] | True |
CCompiler._setup_compile | (self, outdir, macros, incdirs, sources, depends,
extra) | Process arguments and decide which source files to compile. | Process arguments and decide which source files to compile. | def _setup_compile(self, outdir, macros, incdirs, sources, depends,
extra):
"""Process arguments and decide which source files to compile."""
if outdir is None:
outdir = self.output_dir
elif not isinstance(outdir, str):
raise TypeError("'output_dir'... | [
"def",
"_setup_compile",
"(",
"self",
",",
"outdir",
",",
"macros",
",",
"incdirs",
",",
"sources",
",",
"depends",
",",
"extra",
")",
":",
"if",
"outdir",
"is",
"None",
":",
"outdir",
"=",
"self",
".",
"output_dir",
"elif",
"not",
"isinstance",
"(",
"... | [
309,
4
] | [
350,
53
] | python | en | ['en', 'en', 'en'] | True |
CCompiler._fix_compile_args | (self, output_dir, macros, include_dirs) | Typecheck and fix-up some of the arguments to the 'compile()'
method, and return fixed-up values. Specifically: if 'output_dir'
is None, replaces it with 'self.output_dir'; ensures that 'macros'
is a list, and augments it with 'self.macros'; ensures that
'include_dirs' is a list, and au... | Typecheck and fix-up some of the arguments to the 'compile()'
method, and return fixed-up values. Specifically: if 'output_dir'
is None, replaces it with 'self.output_dir'; ensures that 'macros'
is a list, and augments it with 'self.macros'; ensures that
'include_dirs' is a list, and au... | def _fix_compile_args(self, output_dir, macros, include_dirs):
"""Typecheck and fix-up some of the arguments to the 'compile()'
method, and return fixed-up values. Specifically: if 'output_dir'
is None, replaces it with 'self.output_dir'; ensures that 'macros'
is a list, and augments it... | [
"def",
"_fix_compile_args",
"(",
"self",
",",
"output_dir",
",",
"macros",
",",
"include_dirs",
")",
":",
"if",
"output_dir",
"is",
"None",
":",
"output_dir",
"=",
"self",
".",
"output_dir",
"elif",
"not",
"isinstance",
"(",
"output_dir",
",",
"str",
")",
... | [
361,
4
] | [
391,
47
] | python | en | ['en', 'en', 'en'] | True |
CCompiler._prep_compile | (self, sources, output_dir, depends=None) | Decide which souce files must be recompiled.
Determine the list of object files corresponding to 'sources',
and figure out which ones really need to be recompiled.
Return a list of all object files and a dictionary telling
which source files can be skipped.
| Decide which souce files must be recompiled. | def _prep_compile(self, sources, output_dir, depends=None):
"""Decide which souce files must be recompiled.
Determine the list of object files corresponding to 'sources',
and figure out which ones really need to be recompiled.
Return a list of all object files and a dictionary telling
... | [
"def",
"_prep_compile",
"(",
"self",
",",
"sources",
",",
"output_dir",
",",
"depends",
"=",
"None",
")",
":",
"# Get the list of expected output (object) files",
"objects",
"=",
"self",
".",
"object_filenames",
"(",
"sources",
",",
"output_dir",
"=",
"output_dir",
... | [
393,
4
] | [
407,
26
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.