Level 7 : Consider the following file structure and content. If `python -m unittest discover -s tests` is executed from the `my_project` directory, will `test_standalone_function` be discovered and executed by `unittest`?


# File: my_project/tests/sub_tests/test_feature.py
import unittest

def test_standalone_function():
    """This function is not part of a unittest.TestCase class."""
    pass

class FeatureTest(unittest.TestCase):
    def test_feature_method(self):
        """This method is part of a unittest.TestCase class."""
        pass

Author: Ramya | Tags: test-discovery | 1859+ Python FAQs | Share
while-and-for-loop | introduction-to-python | bitwise | decorator | class-decorators | assert | center | class | class-and-instance-variable | complex | append | assignment-operator | bitwise-operator | data-structures-in-python | arithmetic-operation | class-and-inheritance | boolean-masking | rollback | collection | string-method | string-slicing | creating-custom-modules | access-modifier | call | bitwise-operator | staticmethod | regular-expressions | control-flow | arithmetic-expression | conditional-statements | syntax | dictionary-comprehensions | arbitrary-arguments-(*args,-**kwargs) | comparison | array | data-type-conversions | software-design | context-manager | regular-expression | odd-number | boolean | dictionaries | default-mutable-argument | list-method | round-function | method | pandas | literal-characters-and-special-characters | dictionary-methods | conditional-statement | memory | oop | operator-and | nested-loop | sum() | collections | built-in-function | __init_subclass__ | syntax-error | string | swapping | boolean-and-non-boolean | split | conditional-statement | recurssion | managing-directories-with-os-and-shutil | multiple-inheritance | sorted | syntax-error | async | sorting | threading | complex-number | difference-between-threads-and-processes | creating-and-starting-threads | basic | iterator | oops | with-statement | conversion | operations | constructor | pass | implementation | list-join | time-series-with-pandas | data_structure | iterators | postfix | list-methods-and-slicing | using-os-and-pathlib-modules | identity-operator | string-formatting | aggregating-data-with-functools.reduce() | introduction-to-threads | __future__ | touples | import-method | set | binary-operation | working-with-temporary-files-using-tempfile | memory-management | using-else-and-finally | python-django | assignment-operators | key-value-pairs | id-function | multiprocessing | sorting-and-ranking | using-join()-and-is_alive()-methods | built-in | counter | defining-functions | virtual-environment | set-operation | strings | precedence | join | global-variable | string-methods | yield | indentation | comprehension | destructor | file_handling | round | choice | recursion | numeric | fabs-function | python-module | compute | pickling--unpickling | shallow-copy | command-line-parsing | version | mathematical-function | single-inheritance | data-structures | string-iteration | list-comprehension | data-types | data-type | design-principle | using-the-threading-module | data-structure | list-vs-tuple | input | control-flow | datatype | logical-operator | lists | debugging | anchors-(^,-$) | list-slicing | handling-missing-values-(fillna,-dropna) | parsing-with-strptime | directory-operations | datetime.date,-datetime.time,-datetime.datetime | loops | decimal | list-comprehension | max-min | string-slicing | format | overflow | reading-and-writing-large-files-efficiently | reading:-read(),-readline(),-readlines() | keyword | raise | matrix | thread-safe-data-structures-(queue.queue) | list-mutation | __all__-attribute | dicts | turtle | operator-or | advanced-file-operations | python-syntax-and-structure | expand-tab | loop-control | using-lists-as-stacks | working-with-dates-and-times | random | sets | asyncio | identity-operators-(is,-is-not) | map-function | namespace | update | booleans | control-statement | lambdas | global-keyword | error | function-argument | class-and-object | variable | raise-statement | generators-in-python | binary | attribute | else-statement | function | sys | walking-through-directories-using-os.walk() | list-operation | dictionary | encoding | datetime | built-in-function | multithreading | deep-copy | integers | magic-method | method-overloading | condition | syntaxerror | benefit | asyncio-module | comment | logical-operators | object-attribute | data-structure | descriptors | numpy | logical-operator | typeerror | while-loops | return-statement | operand | frozenset | counter-function | sys-module | matplotlib | default-arguments | regex | built-in-modules | random-function | namedtuple | quantifiers-(*,-+,-?,-{}) | def | introduction-to-multiprocessing | application | copy | zip | function-and-scope | list-comprehensions | python-repl | data-type | dataframe-and-series-objects | invalid-list | classes | docstring | version-check | math | lambda-function | int | error-handling | mysql | functional-programming | immutability | membership-operators-(in,-not-in) | expression | floating-point-precision | interpreter | methods | working-with-file-paths | exception-handling | file-handling | loop-control-statements | statement | joining-and-merging-dataframes | type_conversion | zip-function | operator | opening-files-(open()) | identity-operator | slicing | zfill-function | head-and-tail | math-copysign | parameter | filter | scientific-notation | list,-set,-and-dictionary-comprehensions | python_version | indexing:-loc-vs-iloc | working-with-binary-files-(rb,-wb) | logical-operation | exponentiation | module | encapsulation | string-method | using-map()-for-transformations | generators | mathematics | name-mangling | operator-overloading | for | global | exception-handling | overriding-methods | static-method | type-conversion-and-casting | tuples | min-max-function | iterable | using-assertions-(assertequal,-assertraises) | matrix-list-comprehension | init | match | thread-synchronization | precedence-and-associativity | gil | why-use-multiprocessing-over-threading?-(gil) | thread | pep | while-else-loop | enumerate() | floats | print | heap-memory | polymorphism | functional-programming | slice | stack | mutable | tuple-methods | test-discovery | mapping-function | error-handling | input-function | integer | tuple-unpacking | sum-function | indexing | else | functions | min-function | filtering-and-indexing | list-indexing | virtual-environment | string-concatenation | pseudocode | file-handling | factorial-function | package-management | string-formatting | type-conversion | lambda-functions | escape-operator | writing:-write(),-writelines() | file | multiple-except-blocks | feature | higher-order-function | range | filter-function | formatting-with-strftime | type-conversion | loop | global-variable | reading-and-writing-files | installation | while-loop | inheritance | python-operators | goto-function | python-history | unit-testing | print-statement | exception | identifier | tuple | generator | inherit | lambda | python | string-manipulation | immutable-data-type | objects | input-function | operators | list | using-yield-in-functions | library | multiple-inheritance | formal-and-actual-parameter | intering ...