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